a, p, s, m = map(int, input().split()) ls = [p for i in range(12)] for i in range(s,s+m,1): ls[i-1] = p*2 print(ls) cnt = 0 while a > 0: for i in ls: if a > 0: a -= i cnt += 1 else: break print(cnt)