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>
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
I'm working for the day I will surpass you
https://www.a2oj.com/Ladder16.html
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class B
   {
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));  
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int M = Integer.parseInt(st.nextToken());
         long K = Long.parseLong(st.nextToken());
         int[] arr1 = readArr(N, infile, st);
         int[] arr2 = readArr(M, infile, st); //vertical
         //section
         ArrayList<Integer> ls = new ArrayList<Integer>();
         int boof = 0;
         for(int i=0; i < N; i++)
         {
            if(arr1[i] == 1)
               boof++;
            else if(boof > 0)
            {
               ls.add(boof);
               boof = 0;
            }
         }
         if(boof > 0)
            ls.add(boof);
         //include K itself?
         ArrayList<Long> div = findDiv(K);
         long res = 0L;
         for(long x: div)
         {
            long times = 0L;
            int cnt = 0;
            for(int i=0; i < Math.min(x, M); i++)
               cnt += arr2[i];
            if(cnt == x)
               times++;
            if(M < x)
               continue;
            for(int i=1; i < M; i++)
            {
               if(x+i-1 >= M)
                  break;
               cnt += arr2[(int)x+i-1]-arr2[i-1];
               if(cnt == x)
                  times++;
            }
            //bash horizontally
            long y = K/x;
            int cnt2 = 0;
            if(y <= N)
            {
               for(int i=0; i < y; i++)
                  cnt2 += arr1[i];
               if(cnt2 == y)
                  res+=times;
               for(int i=1; i < N; i++)
               {
                  if(i+y-1 >= N)
                     break;
                  cnt2 += arr1[(int)y+i-1]-arr1[i-1];
                  if(cnt2 == y)
                     res+=times;
               }
            }
         }
         System.out.println(res);
      }
      public static int[] readArr(int N, BufferedReader infile, StringTokenizer st) throws Exception
      {
         int[] arr = new int[N];
         st = new StringTokenizer(infile.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         return arr;
      }
      public static ArrayList<Long> findDiv(long N)
      {
         //gens all divisors of N
         ArrayList<Long> ls1 = new ArrayList<Long>();
         ArrayList<Long> ls2 = new ArrayList<Long>();
         for(int i=1; i <= (int)(Math.sqrt(N)+0.00000001); i++)
            if(N%i == 0)
            {
               ls1.add((long)i);
               ls2.add(N/i);
            }
         Collections.reverse(ls2);
         for(long b: ls2)
            if(b != ls1.get(ls1.size()-1))
               ls1.add(b);
         return ls1;
      }
   }