#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; int main(){ int N, M, P, Q; cin >> N >> M >> P >> Q; int month = 1; int ret = 1; while(true){ if(P <= month && month < P + Q) N -= 2 * M; else N -= M; //cout << month << " " << N << endl; if(N <= 0) break; ret++; month++; if(month >= 13) month = 1; } cout << ret << endl; return 0; }