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.util.*;

public class Solution {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    public static void solve(Scanner in){
        int n = in.nextInt();
        int m = in.nextInt();

        int target = in.nextInt();
        HashSet<Rectangle> targetRectangles = toRectangles(target);
        if(targetRectangles.size() == 0) {
            System.out.println("0");
            return;
        }

        List<Integer> col1 = readInput(in, n);
        HashMap<Integer, Integer> col1f = countFrequencies(col1);
        List<Integer> col2 = readInput(in, m);
        HashMap<Integer, Integer> col2f = countFrequencies(col2);

        long total = 0;
        for(int ax1 : col1f.keySet()) {
            for(int ax2 : col2f.keySet()) {
                Rectangle outer = new Rectangle(ax1, ax2);
                long subTotal = 0;
                for(Rectangle inner : targetRectangles) {
                    subTotal += outer.countFitsIn(inner);
                }
                total += subTotal * col1f.get(ax1) * col2f.get(ax2);
            }
        }
        System.out.println(total);
    }

    private static HashSet<Rectangle> toRectangles(int target) {
        HashSet<Rectangle> results = new HashSet<>();
        if(target <= 40000) {
            results.add(new Rectangle(1, target));
            results.add(new Rectangle(target, 1));
        }

        int limit = (int) Math.ceil(Math.sqrt(target));
        for(int i = 2; i <= limit; i++) {
            if(target % i == 0) {
                int j = target / i;
                if(i <= 40000 && j <= 40000) {
                    results.add(new Rectangle(i, j));
                    results.add(new Rectangle(j, i));
                }
            }
        }
        return results;
    }

    private static HashMap<Integer, Integer> countFrequencies(List<Integer> input) {
        HashMap<Integer, Integer> frequencies = new HashMap<>();
        for(int num : input) {
            frequencies.put(num, frequencies.getOrDefault(num, 0) + 1);
        }
        return frequencies;
    }

    private static ArrayList<Integer> readInput(Scanner in, int count) {
        int[] col = new int[count];
        for(int i = 0; i < count; i++) col[i] = in.nextInt();

        ArrayList<Integer> continiousOnes = new ArrayList<>();
        boolean wasPrev1 = false;
        int current = 0;
        for(int val : col) {
            if(val == 1) {
                wasPrev1 = true;
                current++;
            }else{
                if(wasPrev1) {
                    wasPrev1 = false;
                    continiousOnes.add(current);
                    current = 0;
                }
            }
        }
        if(wasPrev1) {
            continiousOnes.add(current);
        }
        return continiousOnes;
    }
}

class Rectangle {
    int axis1;
    int axis2;

    public Rectangle(int axis1, int axis2) {
        this.axis1 = axis1;
        this.axis2 = axis2;
    }

    public long countFitsIn(Rectangle inner) {
        if(axis1 < inner.axis1) return 0;
        if(axis2 < inner.axis2) return 0;
        long shiftsAx1 = axis1 - inner.axis1 + 1;
        long shiftsAx2 = axis2 - inner.axis2 + 1;
        return shiftsAx1 * shiftsAx2;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Rectangle rectangle = (Rectangle) o;
        return axis1 == rectangle.axis1 &&
                axis2 == rectangle.axis2;
    }

    @Override
    public int hashCode() {
        return Objects.hash(axis1, axis2);
    }
}
