#include <bits/stdc++.h>
using namespace std;
map<pair<long long, long long>, long long> x;
long long L, R;
long long dfs(long long n, long long l, long long r) {
  long long sum = 0;
  if (l == r) return n;
  long long m = l + (r - l) / 2;
  if (m + 1 <= R) sum += dfs(n / 2, m + 1, r);
  if (m - 1 >= L) sum += dfs(n / 2, l, m - 1);
  if (m >= L && m <= R) sum += n % 2;
  return sum;
}
int main() {
  long long n;
  scanf("%I64d %I64d %I64d", &n, &L, &R);
  long long cnt = 0, mx = 1, nm = n;
  x.clear();
  while (nm) {
    nm /= 2;
    cnt++;
  }
  mx = (mx << cnt) - 1;
  printf("%I64d\n", dfs(n, 1, mx));
  return 0;
}
