let n = readLine()!.split(separator: " ").map{Int($0)!} let (N,M,P,Q) = (n[0],n[1],n[2],n[3]) var l = [Int](repeating: M, count: 12) for i in (P-1)...(P+Q-2){ l[i] += M } let y = l.reduce(0){$0 + $1} var (m,o) = ((N / y) * 12,N % y) for i in l{ if o <= 0{break} m += 1 o -= i } print(m)