#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
long long int n, m, t, ans, cases;
string s, s2, s3;
int ar[(int)(1e6 + 10)];
void brainfuck();
long long int rec(long long int l, long long int r, long long int val,
                  long long int pos) {
  if (l == r || l > r) return val;
  long long int mid = (l + r) >> 1;
  if (pos == mid) return rec(mid, mid, val % 2, pos);
  if (pos > mid) return rec(mid + 1, r, val / 2, pos);
  return rec(l, mid - 1, val / 2, pos);
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  t = 1;
  while (t--) brainfuck();
  return 0;
}
void brainfuck() {
  long long int l, r, a, b, c;
  cin >> n >> l >> r;
  m = log2(n);
  m = pow(2, m + 1);
  m--;
  for (long long int i = l; i <= r; i++) {
    ans += rec(1, m, n, i);
  }
  cout << ans;
}
