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>
#!/usr/bin/env python3

import math

def get_prime_factors(n):
    prime_factors = []

    factor = 2
    lim = math.sqrt(n)
    while n != 1 and factor <= lim:
        count = 0
        while n % factor == 0:
            n //= factor
            count += 1
        if count > 0:
            prime_factors.append((factor, count))
            lim = math.sqrt(n)
        if factor == 2:
            factor += 1
        else:
            factor += 2
    if n != 1:
        prime_factors.append((n, 1))

    return prime_factors


def get_factors(prime_factors):
    factors = [1]

    if len(prime_factors) != 0:
        mult = [0] * len(prime_factors)
        mult[0] = 1

        cont = True
        while cont:
            factor = 1
            for i in range(len(mult)):
                if mult[i] != 0:
                    factor *= prime_factors[i][0] ** mult[i]
            factors.append(factor)
            cont = False
            for i in range(len(mult)):
                mult[i] += 1
                if mult[i] > prime_factors[i][1]:
                    mult[i] = 0
                else:
                    cont = True
                    break

    return sorted(factors)


n, m, k = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

prime_factors = get_prime_factors(k)
factors = get_factors(prime_factors)

def get_sorted_intervals(a):
    a1 = []
    for i in range(len(a)):
        if a[i] == 1:
            if i == 0 or a[i - 1] == 0:
                a1.append(1)
            else:
                a1[-1] += 1
    a1 = sorted(a1)
    a = []
    for i in range(len(a1)):
        if len(a) != 0 and a[-1][0] == a1[i]:
            a[-1][1] += 1
        else:
            a.append([a1[i], 1])
    return a

a = get_sorted_intervals(a)
b = get_sorted_intervals(b)

cache = {}
def get_count(p):
    if p in cache:
        return cache[p]
    x, y = p
    count = 0
    for factor in factors:
        x1 = factor
        y1 = k // factor
        if x1 <= x:
            if y1 <= y:
                count += (x - x1 + 1) * (y - y1 + 1)
        else:
            break
    cache[p] = count
    return count

count = 0
for i in a:
    for j in b:
        count += i[1] * j[1] * get_count((min(i[0], j[0]), max(i[0], j[0])))

print(count)
