#include <iostream>
using namespace std;
int main(){
freopen("candy.in","r",stdin);
freopen("candy.out","w",stdout);
int n,L,R;
cin>>n>>L>>R;
if(R/n>L/n){
cout << n - 1 << endl;
}else{
cout << R % n << endl;
}
return 0;
}
05-18
359

08-05