#include using namespace std; const long long mod = 1e9 + 7; const long double pi = acos(-1.0); typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, m, k; cin >> n >> m >> k; char op; cin >> op; vector b(m); vector a(n); for(int i = 0; i < m; i++) { cin >> b[i]; } sort(b.begin(), b.end()); for(int i = 0; i < n; i++) { cin >> a[i]; } int ans = 0; for(int i = 0; i < n; i++) { ll right, left, mid; right = m; left = -1; while(right - left > 1) { mid = (right + left) / 2; if(op == '+') { if(a[i] + b[mid] < k) { left = mid; }else { right = mid; } }else if(op == '*') { if(a[i] * b[mid] < k) { left = mid; }else { right = mid; } } } ans += m - right; } cout << ans << endl; }