推公式
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>
using namespace std;
int n, L, R;
int main() {
cin >> n >> L >> R;
if (L / n == R / n) cout << R % n << endl;
else cout << n - 1 << endl;
return 0;
}