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.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CountSubrectangles {
	static int mod = 1000000007;
	static long L_INF = (1L << 60L);

	static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[500005]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}

	public static void main(String[] args) throws IOException {
		Reader in = new Reader();
		int i, t = 0, n, j, m, k;
		long ans = 0;
		n = in.nextInt();
		m = in.nextInt();
		k = in.nextInt();
		int a[] = new int[n];
		int b[] = new int[m];
		Map<Integer, Integer> ac = new HashMap<>();
		Map<Integer, Integer> bc = new HashMap<>();
//		List<Integer> ac = new ArrayList<>();
//		List<Integer> bc = new ArrayList<>();
		for (i = 0; i < n; i++) {
			a[i] = in.nextInt();
			if (a[i] == 1) {
				t++;
			} else {
				if (t != 0)
					ac.put(t, ac.getOrDefault(t, 0) + 1);
				t = 0;
			}
		}
		if (t != 0)
			ac.put(t, ac.getOrDefault(t, 0) + 1);
		t = 0;
		for (i = 0; i < m; i++) {
			b[i] = in.nextInt();
			if (b[i] == 1) {
				t++;
			} else {
				if (t != 0)
					bc.put(t, bc.getOrDefault(t, 0) + 1);
				t = 0;
			}
		}
		if (t != 0)
			bc.put(t, bc.getOrDefault(t, 0) + 1);
		// k divisiors
//		System.out.println("ac " + ac);
//		System.out.println("bc "/ + bc);
		List<Integer> div = new ArrayList<>();
		for (i = 1; i * i <= k; i++) {
			if (k % i == 0) {
				div.add(i);
				if (i * i != k)
					div.add(k / i);
			}
		}
//		System.out.println(div);
		for (i = 0; i < div.size(); i++) {
			int x = div.get(i);
			int y = k / x;
			for (Map.Entry<Integer, Integer> ae : ac.entrySet()) {
				int temp = ae.getKey() - x + 1;
				if (temp <= 0)
					continue;
				for (Map.Entry<Integer, Integer> be : bc.entrySet()) {
					if ((be.getKey() - y + 1) <= 0)
						continue;
					ans += temp * (be.getKey() - y + 1) * ae.getValue() * be.getValue();
//					System.out.println(ans);
				}
			}
//			System.out.println(x + " " + ans);
		}
		System.out.println(ans);
	}
}
