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.*;
import java.math.*;
import java.lang.*;
 
import static java.lang.Math.*;
 
public class Cf182 implements Runnable 
{
	static class InputReader 
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
		public InputReader(InputStream stream) 
		{
			this.stream = stream;
		}
		
		public int read()
		{
			if (numChars==-1) 
				throw new InputMismatchException();
            
			if (curChar >= numChars) 
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}
                
				if(numChars <= 0)               
					return -1;
			}
			return buf[curChar++];
		}
     
		public String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}	
			return str;
		}
		public int nextInt() 
		{
			int c = read();
            
			while(isSpaceChar(c)) 
				c = read();
		
			int sgn = 1;
        
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
            
			int res = 0;
			do
			{
				if(c<'0'||c>'9') 
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c)); 
        
			return res * sgn;
		}
        
		public long nextLong() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;
			
			do 
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}	
			while (!isSpaceChar(c));
				return res * sgn;
		}
		
		public double nextDouble() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') 
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') 
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}
    
		public String readString() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do 
			{
				res.appendCodePoint(c);
				c = read();
			} 
			while (!isSpaceChar(c));
            
			return res.toString();
		}
     
		public boolean isSpaceChar(int c) 
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
     
		public String next()
		{
			return readString();
		}
        
		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	public static void main(String args[]) throws Exception 
	{
		new Thread(null, new Cf182(),"Main",1<<27).start();
	}	
	
	public static long gcd(long a, long b) 
	{ 
		if (a == 0) 
			return b; 
		return gcd(b % a, a); 
	} 
  
	public static long findGCD(long arr[], int n) 
	{ 
		long result = arr[0]; 
		for (int i = 1; i < n; i++) 
			result = gcd(arr[i], result); 
		return result; 
	}	 
	
	static void sortbycolomn(long arr[][], int col)
    { 
         
        Arrays.sort(arr, new Comparator<long[]>() { 
            
          @Override              
           
          public int compare(final long[] entry1,  
                             final long[] entry2) { 
  
            
            if (entry1[col] > entry2[col]) 
                return 1; 
            else
                return -1; 
          } 
        });   
    } 
	static int ncr(int n, int k) 
    { 
        int C[][] = new int[n+1][k+1]; 
        int i, j; 
      
        
        for (i = 0; i <= n; i++) 
        { 
            for (j = 0; j <= min(i, k); j++) 
            { 
                
                if (j == 0 || j == i) 
                    C[i][j] = 1; 
       
            
                else
                    C[i][j] = C[i-1][j-1] + C[i-1][j]; 
            }  
        } 
       
        return C[n][k]; 
    } 
    
    
	public void run()
	{
		InputReader in = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		
		int n=in.nextInt();
		int m=in.nextInt();
		int k=in.nextInt();
		int[] narr=new int[n];
		int[] marr=new int[m];
		for(int i=0;i<n;i++)
		    narr[i]=in.nextInt();
		for(int i=0;i<m;i++)
		    marr[i]=in.nextInt();
		
		long[] nhas=new long[n+1];
		long[] mhas=new long[m+1];
		int count=0; 
		
		
		for(int i=0;i<n;i++)
		{
		    if(narr[i]==1)
		        count++;
		    else
		    {
		        for(int j=1;(j<=count && j<=k);j++)
		            nhas[j]=nhas[j]+count-j+1;
                count=0;
		    }
	    }
	    if(count!=0)
	    {
	            for(int j=1;(j<=count && j<=k);j++)
		            nhas[j]=nhas[j]+count-j+1;
                count=0;
	    }
		
		for(int i=0;i<m;i++)
		{
		    if(marr[i]==1)
		        count++;
		    else
		    {
		        for(int j=1;(j<=count && j<=k);j++)
		            mhas[j]=mhas[j]+count-j+1;
                count=0;
		    }
	    }
		if(count!=0)
		{
		    for(int j=1;(j<=count && j<=k);j++)
		            mhas[j]=mhas[j]+count-j+1;
                count=0;
		}
		
	/*	for(int i=0;i<nhas.length;i++)
		    w.print(nhas[i]+" ");
		    w.println();
		
		for(int i=0;i<mhas.length;i++)
		    w.print(mhas[i]+" ");
		    w.println();
	*/	
		
		nhas[0]=nhas[1];
		mhas[0]=mhas[1];
		
		long total=0;
		
		if(k%2==0)
		{
		    
		    ArrayList<Integer> ftr=new ArrayList<>();
		    for(int i=1;i<=Math.sqrt(k);i++)
		    {
		        if(k%i==0)
		        {
		            ftr.add(i);
		            if(i!=(k/i))
		                ftr.add(k/i);
		        }
		    }
		    int b=0,h=0;
		    for(int i=0;i<ftr.size();i++)
		    {
		        b=ftr.get(i);
		        h=k/b;
		        if(b<=n && h<=m)
		              total=(long)(total+(long)(nhas[b]*mhas[h]));
		    }
		}
		else
		{
		       
		        
		        if(m==1)
		        {    
		            if(k<=n)
		                total=(long)nhas[k];
		        }
		        else if(n==1)
		        {
		            if(k<=m)
		                total=(long)(total+mhas[k]);
		        }
		        else
		        {
		            if(k==1)
		                total=(long)(nhas[1]*mhas[1]);
		            else{
		            if(k<=n)
		                total=(long)(nhas[k]*mhas[1]);
		            if(k<=m)
		                total=(long)(total+(long)(mhas[k]*nhas[1]));
		            }
		        }
		        
		        
		}
		
		w.println(total);
		
		    
		
		
		
		    
		w.flush();
		w.close();
	}
}