INTEGER N,A,B,X,ANS
CHARACTER(20) S
READ*,N,A,B
ANS=0
DO I=1,N
  X=0
  WRITE(S,"(I0)") I
  DO J=1,LEN_TRIM(S)
    X=X+ICHAR(S(J:J))-ICHAR("0")
  END DO
  IF( A<=X .AND. X<=B)ANS=ANS+I
END DO
PRINT"(I0)",ANS
END