#include <bits/stdc++.h>
using namespace std ;
int main(){
    long long h , m , n , t ;
    cin >> h >> m >> n >> t ;
    long long x = ( t - 1 ) * m * n + 1 ;
    if ( x <= h )
        cout << x ;
    else
        cout << 0 ;
}
