using System; using System.Linq; namespace lv1_804 { class Program { static void Main(string[] args) { int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); int a = input[0], b = input[1], c = input[2], d = input[3]; while (a + c * a >= d) { if (a == 0) break; a--; } Console.WriteLine(a); } } }