import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) #処理内容 def main(): N, M, P, Q = getlist() L = [0] * 12 for i in range(P - 1, P - 1 + Q): L[i] = 1 # print(L) cnt = 0 while True: if L[cnt % 12] == 1: N -= 2 * M else: N -= M if N <= 0: print(cnt + 1) return cnt += 1 if __name__ == '__main__': main()