#include using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N,M; ll K; cin >> N >> M >> K; char op; cin >> op; vector A(N),B(M); for (int i=0;i> B[i]; for (int i=0;i> A[i]; sort(B.begin(),B.end()); reverse(B.begin(),B.end()); sort(A.begin(),A.end()); ll ans=0,now=0; for (int i=0;i=K) ++now; else while(now=K) ++now; ans+=now; } cout << ans << '\n'; }