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