import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int p = sc.nextInt(); int q = sc.nextInt(); int a = 0; int mo = 1; while(n > 0){ a++; if(mo >= p && mo <= p + q - 1){ n -= 2*m; }else{ n -=m; } mo++; if(mo == 13){ mo = 1; } } System.out.print(a); } }