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

public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        new Main().run(in, out);
        out.close();
    }

    public static long mod = 17352642619633L;

    void run(FastScanner in, PrintWriter out) {
        int N = in.nextInt();
        int M = in.nextInt();
        int K = in.nextInt();

        int[] a = new int[N];
        int[] b = new int[M];
        for (int i = 0; i < N; i++) a[i] = in.nextInt();
        for (int i = 0; i < M; i++) b[i] = in.nextInt();

        long[] acnt = new long[N+1];
        long[] bcnt = new long[M+1];

        for (int i = 0; i < N; ) {
            if (a[i] == 0) {
                i++;
                continue;
            }
            int len = 0;
            while (i < N && a[i] == 1) {
                len++;
                i++;
            }
            acnt[len]++;
        }

        for (int i = 0; i < M; ) {
            if (b[i] == 0) {
                i++;
                continue;
            }
            int len = 0;
            while (i < M && b[i] == 1) {
                len++;
                i++;
            }
            bcnt[len]++;
        }

        // System.out.println(Arrays.toString(acnt));
        // System.out.println(Arrays.toString(bcnt));
        // System.out.println();

        int cnt = 0;
        long add = 0;
        for (int i = N; i >= 0; i--) {
            add += cnt;

            cnt += acnt[i];
            add += acnt[i];

            acnt[i] = add;
        }

        cnt = 0; add = 0;
        for (int i = M; i >= 0; i--) {
            add += cnt;

            cnt += bcnt[i];
            add += bcnt[i];
            bcnt[i] = add;
        }

        // System.out.println(Arrays.toString(acnt));
        // System.out.println(Arrays.toString(bcnt));

        long ret = 0;
        for (int p = 1; p*p <= K; p++) {
            if (K%p != 0) continue;

            int p1 = p; int p2 = K/p1;
            if (p1 <= N && p2 <= M) {
                ret += acnt[p1] * bcnt[p2];
            }
            if (p1 != p2 && p2 <= N && p1 <= M) {
                ret += acnt[p2] * bcnt[p1];
            }
        }

        out.println(ret);
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

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

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

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