def main(): a, b, c, d = map(int, input().split(' ')) unit = a + c count = 0 while unit <= d and count * c <= b - 1: count += 1 print(count) if __name__ == '__main__': main()