#include <bits/stdc++.h>
using namespace std;
long long n, L, R;
long long solve(long long n, long long left, long long right) {
  if (left > R || right < L) return 0;
  if (n < 2) {
    if (left >= L && right <= R)
      return n;
    else
      return 0;
  }
  long long mid = (left + right) >> 1;
  return solve(n / 2, left, mid - 1) + solve(n % 2, mid, mid) +
         solve(n / 2, mid + 1, right);
}
int main() {
  cin >> n >> L >> R;
  long long len = 1;
  while (len < n) len = len * 2 + 1;
  cout << solve(n, 1, len) << endl;
}
