#include using namespace std; #define rep(i,n) for(int i=0;i<(n);++i) #define reps(i,n) for(int i=1;i<=(n);++i) #define all(x) (x).begin(),(x).end() #define Fixed fixed << setprecision(14) #define int int64_t using pii = pair; constexpr int INF = 0x3f3f3f3f; constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL; constexpr int mod1 = 1e9+7; constexpr int mod2 = 998244353; template inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); } template inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); } template using min_heap = priority_queue,greater >; template using max_heap = priority_queue; template using umap = unordered_map; int gcd(int a,int b){ return b ? gcd(b,a % b) : a;} int lcm(int a,int b){ return a / gcd(a,b) * b;} signed main(void){ cin.tie(nullptr); ios_base::sync_with_stdio(false); int n,m,k; char op; cin >> n >> m >> k >> op; vector b(m),a(n); rep(i,m){ cin >> b[i]; } rep(i,n){ cin >> a[i]; } sort(all(b),greater()); auto BinarySearch = [&](int key){ int ok = -1,ng = m; while(ng - ok > 1){ int mid = (ng + ok) / 2; if(op == '+'){ if(b[mid] + key >= k) ok = mid; else ng = mid; }else{ if(b[mid] * key >= k) ok = mid; else ng = mid; } } return ok + 1; }; int res = 0; rep(i,n){ res += BinarySearch(a[i]); } cout << res << '\n'; return 0; }