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.*;
import java.util.stream.Collectors;


public class Main {

    long calc(List<Integer> a, List<Integer> b, int p, int q){
        int ca = 0;
        for (Integer el : a) {
            if(el>=p){
                ca+=el-p+1;
            }
        }
        int cb = 0;
        for (Integer el : b) {
            if(el>=q){
                cb+=el-q+1;
            }
        }
        return (long) ca * cb;
    }


    void solve() {
        int n = in.nextInt();
        int m = in.nextInt();
        int k = in.nextInt();
        int[] a = in.nextInts(n);
        int[] b = in.nextInts(m);
        List<Integer> ca = new ArrayList<>();
        List<Integer> cb = new ArrayList<>();
        int count = 0;
        for(int i=0;i<n;i++){
            if(a[i]==1) count++;
            else if(count>0){
                ca.add(count);
                count=0;
            }
        }
        if(count>0){
            ca.add(count);
        }

        count = 0;
        for(int i=0;i<m;i++){
            if(b[i]==1) count++;
            else if(count>0){
                cb.add(count);
                count=0;
            }
        }
        if(count>0){
            cb.add(count);
        }
        long ans = 0;
        for(int p = 1;p*p<=k;p++){
            if(k%p==0){
                int q = k/p;
                ans += calc(ca,cb,p,q);
                if(p!=q){
                    ans += calc(ca,cb,q,p);
                }
            }
        }
        out.println(ans);
    }

    // --------------------SCANNER-------------------------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner(boolean debug) {
            if (debug) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (FileNotFoundException e) {
                    throw new RuntimeException(e);
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }

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

        int[] nextInts(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

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

        long[] nextLongs(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

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

        String nextLine() {
            try {
                String line = br.readLine();
                if (line == null) {
                    throw new RuntimeException("empty line");
                }
                return line;
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }

    // --------------------WRITER-------------------------
    public static class MyWriter extends PrintWriter {

        public MyWriter(OutputStream out) {
            super(out);
        }

        void println(int[] arr) {
            String line = Arrays.stream(arr).mapToObj(String::valueOf).collect(Collectors.joining(" "));
            println(line);
        }

    }
    // --------------------MAIN-------------------------

    public MyScanner in;
    public MyWriter out;

    public static void main(String[] args) {
        Main m = new Main();
        m.in = new MyScanner(args.length > 0);
        m.out = new MyWriter(new BufferedOutputStream(System.out));
        m.solve();
        m.out.close();
    }
}