class Program { static void Main(string[] args) { string[] tree = Console.ReadLine().Split(' '); int maxLeaf = int.Parse(tree[0]); int decrease = int.Parse(tree[1]); int month = int.Parse(tree[2]); int count = 0; List list = new List(); for(int i = 0; i < int.Parse(tree[3]); i++) { list.Add(month); month++; if(month == 13) { month = 1; } } month = 1; while(maxLeaf > 0) { count++; if( list.IndexOf(month) == -1) { maxLeaf -= decrease; } else { maxLeaf -= decrease * 2; } month++; if(month == 13) { month = 1; } } Console.WriteLine(count); } }