#include<bits/stdc++.h> using namespace std; int main() { int n,L,R,ans; cin>>n>>L>>R; for(int i=1;ans<=R-n;i++) { ans=n*i-1; } if(ans>=L)cout<<n-1; else cout<<R-ans-1; return 0; }