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>
/**
 * ******* Created  on 7/3/20 2:41 PM*******
 */

import java.io.*;
import java.util.*;

public class B1323 implements Runnable {

    private static final int MAX = (int) (1E5 + 5);
    private static final int MOD = (int) (1E9 + 7);
    private static final long Inf = (long) (1E14 + 10);

    private void solve() throws IOException {
        int n = reader.nextInt();
        int m = reader.nextInt();
        int k = reader.nextInt();
        int[] a = new int[MAX];
        int[] b = new int[MAX];
        for(int i=0;i<n;i++)
            a[i] = reader.nextInt();
        for(int i=0;i<m;i++){
            b[i] = reader.nextInt();
        }
        List<Integer> smalls = new ArrayList<>();
        for(int i=1;i<=Math.sqrt(k);i++){
            if(k%i==0){
                if(i*i!=k)
                    smalls.add(k/i);
                smalls.add(i);
            }
        }


        List<Integer> colums = new ArrayList<>();
        for(int i=0;i<m;){
            while ( i <m && b[i]==0)i++;
            int k1 =i;
            while( k1 < m && b[k1]==1)k1++;
            if(k1-i>0)
                colums.add(k1-i);
            i=k1;
        }
        int i=0, j=0;
        long ans =0;
        Collections.sort(smalls);
        long[] dp = new long[MAX];
        Arrays.fill(dp,-1L);
        while(i < n ){
            while(i<n && a[i]==0)i++;
            int k1 =i;
            while(k1 < n && a[k1]==1)k1++;

            int len1 = k1-i;
            if(dp[len1]!=-1){
                ans += dp[len1];
                i=k1;
                continue;
            }
            long prev =ans;
            for(int l2 = 0; l2 < colums.size();l2++){
                int len2 = colums.get(l2);
                for(int k3=0;k3 < smalls.size() && smalls.get(k3)<= len1;k3++){
                    int val = k/smalls.get(k3);
                    if(val <=len2){
                        ans += (long)(len1-smalls.get(k3)+1) * (long)(len2-val+1);
                    }
                }
            }
            dp[len1] = ans - prev;
            i=k1;
        }
        writer.println(ans);
    }


    public static void main(String[] args) throws IOException {
        try (Input reader = new StandardInput(); PrintWriter writer = new PrintWriter(System.out)) {
            new B1323().run();
        }
    }

    StandardInput reader;
    PrintWriter writer;

    @Override
    public void run() {
        try {
            reader = new StandardInput();
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    interface Input extends Closeable {
        String next() throws IOException;

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

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

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

        default int[] readIntArray() throws IOException {
            return readIntArray(nextInt());
        }

        default int[] readIntArray(int size) throws IOException {
            int[] array = new int[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextInt();
            }
            return array;
        }

        default long[] readLongArray(int size) throws IOException {
            long[] array = new long[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextLong();
            }
            return array;
        }
    }

    private static class StandardInput implements Input {
        private final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        private StringTokenizer stringTokenizer;

        @Override
        public void close() throws IOException {
            reader.close();
        }

        @Override
        public String next() throws IOException {
            if (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                stringTokenizer = new StringTokenizer(reader.readLine());
            }
            return stringTokenizer.nextToken();
        }
    }
}
