m,n,p,q = map(int, input().split()) cnt = 0 while m > 0: for month in range(12): cnt += 1 m -= n if(month >= p and month <= p+q-1): m -= n #print(m) if m <= 0: print(cnt) break