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>
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
from io import BytesIO, IOBase
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,Counter,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('0')

file = 1
def ceil(a,b):
    return (a+b-1)//b




def solve():


    # for _ in range(ii()):
    n,m,k = mi()
    a = li()
    b = li()
    x,y = [],[]
    c = 0
    for i in range(n):
        if a[i] == 0:
            if c > 0:
                x.append(c)
            c = 0
        else:
            c+=1
    if c > 0:
        x.append(c)

    c = 0
    for i in range(m):
        if b[i] == 0:
            if c > 0:
                y.append(c)
            c = 0
        else:
            c+=1
    if c > 0:
        y.append(c)

    x.sort()
    y.sort()
    nx,ny= len(x),len(y)

    sufx = [0]*nx
    sufy = [0]*ny
    
    for i in range(nx-1,-1,-1):
        if i != nx-1:
            sufx[i] += sufx[i+1]
        sufx[i] += x[i]

    for i in range(ny-1,-1,-1):
        if i != ny-1:
            sufy[i] += sufy[i+1]
        sufy[i] += y[i]

    def get(p,q):
        idx1 = bisect_left(x,p)
        idx2 = bisect_left(y,q)
        cnt1,cnt2 = 0,0
        if idx2 < ny:
            cnt2 = sufy[idx2] - (q-1)*(ny-idx2)
        if idx1 < nx:
            cnt1 = sufx[idx1] - (p-1)*(nx-idx1)
        return cnt1*cnt2

    ans = 0
    for i in range(2,int(sqrt(k))+1):
        if k%i == 0:
            p = i
            q = k//i
            ans += get(p,q)
            if p!=q:
                ans += get(q,p)

    ans += get(1,k)
    if k!=1:
        ans += get(k,1)
    print(ans)










            





    
        








        
if __name__ =="__main__":

    if(file):

        if path.exists('tmp/input.txt'):
            sys.stdin=open('tmp/input.txt', 'r')
            sys.stdout=open('tmp/output.txt','w')
        else:
            input=sys.stdin.readline
    solve()
