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.BufferedReader;
import java.io.FileReader;
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.io.*;
public class codeforces 
{ 
   static class Student{
       int x,y;
        Student(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
    static int prime[];
    static void sieveOfEratosthenes(int n) 
    { 
        // Create a boolean array "prime[0..n]" and initialize 
        // all entries it as true. A value in prime[i] will 
        // finally be false if i is Not a prime, else true. 
        int pos=0;
        prime= new int[n+1]; 
        for(int p = 2; p*p <=n; p++) 
        { 
            // If prime[p] is not changed, then it is a prime 
            if(prime[p] == 0)
            { 
                // Update all multiples of p
                prime[p]=p;
                for(int i = p*p; i <= n; i += p) 
                    prime[i] = p; 
            } 
        } 
    }
static    class Sortbyroll implements Comparator<Student> 
{ 
    // Used for sorting in ascending order of 
    // roll number 
    public int compare(Student c, Student b) 
    { 
        if(c.y<=b.y)
            return -1;
        return 1;
    } 
} 
static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        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()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
 
    static class Edge{
        int a,b;
        Edge(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
    static class Trie{
        Trie z,o;
       // int c;
        Trie(){
            z=null;
            o=null;
            //c=0;
        }
    }
    //static long ans;
    static int parent[];
    static int rank[];
    static int b[][];
    static int bo[];
    static int ho[];
    static int seg[];
    //static int pos;
    static long mod=1000000007;
    //static int dp[][];
    static HashMap<String,Integer>map;
    //static Stack<Integer>st;
   // static ArrayList<Character>ans;
    static ArrayList<ArrayList<Integer>>adj;
    //static int ans;
    static Trie root;
    
    static void solve()throws IOException{
        FastReader sc=new FastReader();
        int n,m,k,i,s=0,j;
        //long ans=0;
        n=sc.nextInt();
        m=sc.nextInt();
        k=sc.nextInt();
        int a[]=new int[n];
        int b[]=new int[m];
        for(i=0;i<n;i++)
            a[i]=sc.nextInt();
        for(i=0;i<m;i++)
            b[i]=sc.nextInt();
        ArrayList<Integer>r=new ArrayList<>();
        ArrayList<Integer>c=new ArrayList<>();
        for(i=0;i<n;i++){
            if(a[i]==0){
                if(s!=0)
                    r.add(s);
                s=0;
            }
            else
            ++s;
        }
        if(s!=0)
            r.add(s);
        s=0;
        for(i=0;i<m;i++){
            if(b[i]==0){
                if(s!=0)
                    c.add(s);
                s=0;
            }
            else
            ++s;
        }
        if(s!=0)
            c.add(s);
       // System.out.println(r.get(0)+" "+r.get(1));
        HashMap<Integer,Integer>row=new HashMap<>();
        HashMap<Integer,Integer>col=new HashMap<>();
        for(i=0;i<r.size();i++){
            for(j=1;j<=Math.sqrt(k)&&j<=r.get(i);j++){
                if(k%j==0){
                    if(r.get(i)>=j){
                        if(row.containsKey(j))
                            row.put(j,row.get(j)+r.get(i)-j+1);
                        else
                            row.put(j,r.get(i)-j+1);
                    }
                    if(k/j!=j&&r.get(i)>=k/j){
                        if(row.containsKey(k/j))
                            row.put(k/j,row.get(k/j)+r.get(i)-k/j+1);
                        else
                            row.put(k/j,r.get(i)-k/j+1);
                    }
                }
            }
        }
         for(i=0;i<c.size();i++){
            for(j=1;j<=Math.sqrt(k)&&j<=c.get(i);j++){
                if(k%j==0){
                    if(c.get(i)>=j){
                        if(col.containsKey(j))
                            col.put(j,col.get(j)+c.get(i)-j+1);
                        else
                            col.put(j,c.get(i)-j+1);
                    }
                    if(k/j!=j&&c.get(i)>=k/j){
                        if(col.containsKey(k/j))
                            col.put(k/j,col.get(k/j)+c.get(i)-k/j+1);
                        else
                            col.put(k/j,c.get(i)-k/j+1);
                    }
                }
            }
        }
        long ans=0;
        for(i=1;i<=Math.sqrt(k);i++){
            if(k%i==0){
                if(row.containsKey(i)&&col.containsKey(k/i))
                    ans+=(long)row.get(i)*(long)col.get(k/i);
                if(k/i!=i&&row.containsKey(k/i)&&col.containsKey(i))
                    ans+=(long)row.get(k/i)*(long)col.get(i);
            }
        }
        System.out.println(ans);
    }
    public static void main(String[] args){
        //long sum=0;
        try {
                codeforces.solve();
                } catch (Exception e) {
                    e.printStackTrace();
                }
    }
 /*static long power(long x, long y, long p) 
{ 
    long res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or  
                // equal to p 
  
    /*while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if ((y & (long)1)%2!=0) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p;   
    } */
    //return res%p; 
   static int find(int x) 
    { 
        // Finds the representative of the set 
        // that x is an element of 
        while(parent[x]!=x) 
        { 
            // if x is not the parent of itself 
            // Then x is not the representative of 
            // his set,
            x=parent[x];
  
            // so we recursively call Find on its parent 
            // and move i's node directly under the 
            // representative of this set 
        } 
  
        return x; 
    }
    static void union(int x, int y) 
    { 
        // Find representatives of two sets 
        int xRoot = find(x), yRoot = find(y); 
  
        // Elements are in the same set, no need 
        // to unite anything. 
        if (xRoot == yRoot) 
            return; 
  
         // If x's rank is less than y's rank 
        if (rank[xRoot] < rank[yRoot]) 
  
            // Then move x under y  so that depth 
            // of tree remains less 
            parent[xRoot] = yRoot; 
  
        // Else if y's rank is less than x's rank 
        else if (rank[yRoot] < rank[xRoot]) 
  
            // Then move y under x so that depth of 
            // tree remains less 
            parent[yRoot] = xRoot; 
  
        else // if ranks are the same 
        { 
            // Then move y under x (doesn't matter 
            // which one goes where) 
            parent[yRoot] = xRoot; 
  
            // And increment the the result tree's 
            // rank by 1 
            rank[xRoot] = rank[xRoot] + 1; 
        } 
    } 
    static int gcd(int a, int b) 
    { 
        if (a == 0) 
            return b; 
        return gcd(b % a, a); 
    }
}