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 io
import os

from bisect import bisect_left

from collections import deque, defaultdict, Counter


def makeRepeat(s):
    repeat = [[s[0], 0]]
    for ch in s:
        if ch == repeat[-1][0]:
            repeat[-1][1] += 1
        else:
            repeat.append([ch, 1])
    return repeat


def solve(N, M, K, A, B):
    aRepeats = [c for x, c in makeRepeat(A) if x == 1]
    bRepeats = [c for x, c in makeRepeat(B) if x == 1]
    aRepeats.sort()
    bRepeats.sort()
    aCumSum = [0]
    bCumSum = [0]
    for x in aRepeats:
        aCumSum.append(aCumSum[-1] + x)
    for x in bRepeats:
        bCumSum.append(bCumSum[-1] + x)

    def getCount(d1, d2):
        i = bisect_left(aRepeats, d1)
        j = bisect_left(bRepeats, d2)
        aSum = aCumSum[-1] - aCumSum[i]
        aCount = len(aCumSum) - i - 1
        assert aSum == sum(aRepeats[i:])

        bSum = bCumSum[-1] - bCumSum[j]
        bCount = len(bCumSum) - j - 1
        assert bSum == sum(bRepeats[j:])

        ret = (
            aSum * bSum
            - (d2 - 1) * aSum * bCount
            - (d1 - 1) * bSum * aCount
            + (d1 - 1) * (d2 - 1) * aCount * bCount
        )
        # print("counting", d1, d2)
        # print(aSum, bSum, d2, d1, aCount, bCount)
        # print(ret)
        return ret

    total = 0
    for d1 in range(1, int(K ** 0.5) + 1):
        d2, r = divmod(K, d1)
        if r == 0:
            assert d1 * d2 == K
            total += getCount(d1, d2)
            if d1 != d2:
                total += getCount(d2, d1)

    return total


if __name__ == "__main__":
    input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

    N, M, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    ans = solve(N, M, K, A, B)
    print(ans)
