You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c consists of only zeroes and ones too.

How many subrectangles of size (area) k consisting only of ones are there in c?

A subrectangle is an intersection of a consecutive (subsequent) segment of rows and a consecutive (subsequent) segment of columns. I.e. consider four integers x_1, x_2, y_1, y_2 (1 ≤ x_1 ≤ x_2 ≤ n, 1 ≤ y_1 ≤ y_2 ≤ m) a subrectangle c[x_1 ... x_2][y_1 ... y_2] is an intersection of the rows x_1, x_1+1, x_1+2, ..., x_2 and the columns y_1, y_1+1, y_1+2, ..., y_2.

The size (area) of a subrectangle is the total number of cells in it.

Input

The first line contains three integers n, m and k (1 ≤ n, m ≤ 40 000, 1 ≤ k ≤ n ⋅ m), length of array a, length of array b and required size of subrectangles.

The second line contains n integers a_1, a_2, …, a_n (0 ≤ a_i ≤ 1), elements of a.

The third line contains m integers b_1, b_2, …, b_m (0 ≤ b_i ≤ 1), elements of b.

Output

Output single integer — the number of subrectangles of c with size (area) k consisting only of ones.

Examples

Input


3 3 2
1 0 1
1 1 1


Output


4


Input


3 5 4
1 1 1
1 1 1 1 1


Output


14

Note

In first example matrix c is:

<image>

There are 4 subrectangles of size 2 consisting of only ones in it:

<image>

In second example matrix c is:

<image>
import java.io.*;
import java.util.*;

public class B {
	
	public static boolean DEBUG = true;
	
    public static void main(String[] args) throws IOException {
    	FastScanner scan;
    	PrintWriter out;
    	if (DEBUG) {
    		scan = new FastScanner();
        	out = new PrintWriter(System.out);
    	}
    	else {
        	scan = new FastScanner("test.in");
        	out = new PrintWriter(new BufferedWriter(new FileWriter("test.out")));
    	}
        
        int A = scan.nextInt();
        int B = scan.nextInt();
        int K = scan.nextInt();

        boolean[] arrA = new boolean[A]; 
        for(int i=0; i<A; i++) {
            if(scan.nextInt() == 1) {
                arrA[i] = true;
            }
        }

        boolean[] arrB = new boolean[B]; 
        for(int i=0; i<B; i++) {
            if(scan.nextInt() == 1) {
                arrB[i] = true;
            }
        }

        ArrayList<Integer> al = primeFactorize(K);

        HashSet<Integer> set = new HashSet<Integer>(al);
        ArrayList<Integer> divisors = new ArrayList<Integer>(set);

        Collections.sort(divisors);

        long[] multA = new long[divisors.size()];
        long[] multB = new long[divisors.size()];

        // System.out.println(divisors.toString());

        int size = 0;
        for(int i=0; i<A; i++) {
            if(arrA[i]) size++;
            else size = 0;

            for(int j=0; j<divisors.size(); j++) {
                if(size >= divisors.get(j)) multA[j]++;
            }
        }

        size = 0;
        for(int i=0; i<B; i++) {
            if(arrB[i]) size++;
            else size = 0;

            for(int j=0; j<divisors.size(); j++) {
                if(size >= divisors.get(j)) multB[j]++;
            }
        }

        long ret = 0;
        for(int i=0; i<divisors.size(); i++) {
            ret += multA[i]*multB[divisors.size()-i-1];
        }
        
        System.out.println(ret);
        
        out.close();
    }

    public static ArrayList<Integer> primeFactorize(int n) {

        int sqrtN = (int)Math.sqrt(n);
        
        boolean[] isComposite = primeSieve(sqrtN);
        ArrayList<Integer> ret = new ArrayList<Integer>();

        ret.add(1);
        
        int old = 0;
        while(n%2 == 0) {
            int s = ret.size();
            for(int i=old; i<s; i++) {
                ret.add(ret.get(i)*2);
            }

            old = s;
            n /= 2;
        }

        for(int i=3; i<=n; i+=2) {
                
            if(i > sqrtN) {
                int s = ret.size();
                for(int j=0; j<s; j++) {
                    ret.add(ret.get(j)*n);
                }
                break;
            }
                
            if(isComposite[i]) continue;

            old = 0;
            while(n%i == 0) {
                int s = ret.size();
                for(int j=old; j<s; j++) {
                    ret.add(ret.get(j)*i);
                }

                old = s;
                n /= i;
            }
        }

        return ret;
    }

    public static boolean[] primeSieve(int n) {

        boolean[] isComposite = new boolean[n+1];
        isComposite[1] = true;

        for(int i=2; i<=(int)Math.sqrt(n); i++) {
            if(!isComposite[i]) {
                for(int j=2*i; j<=n; j+= i) {
                    isComposite[j] = true;
                }
            }
        }

        return isComposite;
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }

        int nextInt() {
            return Integer.parseInt(nextToken());
        }

        long nextLong() {
            return Long.parseLong(nextToken());
        }

        double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}