n,l,h,*z=$<.read.split.map &:to_i p (1..n).reduce(0){|r,i|z.combination(i){|v|e=v.inject(1){|s,x|s*x/s.gcd(x)} r-=(-1)**i*i*(h/e-~-l/e)};r}