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 Main {

	static class PairComparator implements Comparator<Pair> {
		@Override
		public int compare(Pair x, Pair y) {
			if (x.val < y.val)return -1;
			if (x.val > y.val)return 1;
			if (x.val == y.val){
				if (x.ind < y.ind)return -1;
				if (x.ind > y.ind)return 1;
			}
			return 0;
		}
	}
/*
 
1 1 1 0 1 1
  1 1 0 0 1
  0 1 0 0 0

*/

    static class Pair{
        int ind, val;
        Pair(int i, int v){
            ind=i;
            val=v;
        }
    }
	static int[] vis;
   static void func() throws Exception {
	   int n,m,k;
	   n= sc.nextInt();
	   m= sc.nextInt();
	   k= sc.nextInt();
	   int a[] = sc.intArr(n);
	   int b[] = sc.intArr(m);
	   List<Integer> segmentA = new ArrayList<>();
	   List<Integer> segmentB = new ArrayList<>();
	   int l=0;
	   for (int i=0;i<n;i++){
		   if (a[i]==0 && l!=0){
			   segmentA.add(l);
			   l=0;
		   }
		   if (a[i]==1)l++;
	   }
	   if (l!=0)segmentA.add(l);
	   l=0;
	   for (int i=0;i<m;i++){
		   if (b[i]==0 && l!=0){
			   segmentB.add(l);
			   l=0;
		   }
		   if (b[i]==1)l++;
	   }
	   if (l!=0)segmentB.add(l);
	   long sum =0;
	   for (int i=1;i*i<=k;i++){
		   if (k%i!=0)continue;
		   int p2 = i, p1=k/i;
		   long sum1=0, sum2=0;
		   for (int j=0;j<segmentA.size();j++){
			   int segA = segmentA.get(j);
			   if (p1<=segA){
				   sum1+=segA-p1+1;
			   }
		   }
		   for (int j=0;j<segmentB.size();j++){
			   int segB = segmentB.get(j);
			   if (p2<=segB){
				   sum2+=segB-p2+1;
			   }
		   }
		   sum += sum1*sum2;

		   
	   }
	   for (int i=1;i*i<=k;i++){
		   if (k%i!=0)continue;
		   int p1 = i, p2=k/i;
		   if (p1==p2)continue;
		   long sum1=0, sum2=0;
		   for (int j=0;j<segmentA.size();j++){
			   int segA = segmentA.get(j);
			   if (p1<=segA){
				   sum1+=segA-p1+1;
			   }
		   }
		   for (int j=0;j<segmentB.size();j++){
			   int segB = segmentB.get(j);
			   if (p2<=segB){
				   sum2+=segB-p2+1;
			   }
		   }
		   sum += sum1*sum2;

		   
	   }
	   pw.println(sum);
	  
   }

/*
 
 * */
    static PrintWriter pw;
    static MScanner sc;

    public static void main(String[] args) throws Exception {

        pw = new PrintWriter(System.out);
        sc = new MScanner(System.in);

        int tests = 1;
     //  tests =sc.nextInt(); //comment this line
        while (tests-- > 0){
            func();
            pw.flush();
        }

    }

    static class MScanner {
        StringTokenizer st;
        BufferedReader br;

        public MScanner(InputStream system) {
            br = new BufferedReader(new InputStreamReader(system));
        }

        public MScanner(String file) throws Exception {
            br = new BufferedReader(new FileReader(file));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int[] intArr(int n) throws IOException {
            int[] in = new int[n];
            for (int i = 0; i < n; i++)
                in[i] = nextInt();
            return in;
        }

        public long[] longArr(int n) throws IOException {
            long[] in = new long[n];
            for (int i = 0; i < n; i++)
                in[i] = nextLong();
            return in;
        }

        public int[] intSortedArr(int n) throws IOException {
            int[] in = new int[n];
            for (int i = 0; i < n; i++)
                in[i] = nextInt();
            shuffle(in);
            Arrays.sort(in);
            return in;
        }

        public long[] longSortedArr(int n) throws IOException {
            long[] in = new long[n];
            for (int i = 0; i < n; i++)
                in[i] = nextLong();
            shuffle(in);
            Arrays.sort(in);
            return in;
        }

        public Integer[] IntegerArr(int n) throws IOException {
            Integer[] in = new Integer[n];
            for (int i = 0; i < n; i++)
                in[i] = nextInt();
            return in;
        }

        public Long[] LongArr(int n) throws IOException {
            Long[] in = new Long[n];
            for (int i = 0; i < n; i++)
                in[i] = nextLong();
            return in;
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

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

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

        public char nextChar() throws IOException {
            return next().charAt(0);
        }

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

        public boolean ready() throws IOException {
            return br.ready();
        }

        public void waitForInput() throws InterruptedException {
            Thread.sleep(3000);
        }
    }

    static void shuffle(int[] in) {
        for (int i = 0; i < in.length; i++) {
            int idx = (int) (Math.random() * (i+1));
            int tmp = in[i];
            in[i] = in[idx];
            in[idx] = tmp;
        }
    }

    static void shuffle(long[] in) {
        for (int i = 0; i < in.length; i++) {
            int idx = (int) (Math.random() * (i+1));
            long tmp = in[i];
            in[i] = in[idx];
            in[idx] = tmp;
        }
    }
}
