a,b,c,d=map(int,input().split()) m=0 for i in range(1,a+1): if i*c<=b and i+c<=d: if m