#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n, m, k; cin >> n >> m >> k; char op; cin >> op; vector b(m); for (int i = 0; i < m; i++) cin >> b[i]; sort(b.begin(), b.end()); long long ans = 0; for (int i = 0; i < n; i++) { int a; cin >> a; ans += m - (lower_bound(b.begin(), b.end(), (op == '*' ? (k + a - 1) / a : k - a)) - b.begin()); } cout << ans << endl; return 0; }