#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 100;
const long long MAXL = 21;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long x, r, l;
  cin >> x >> l >> r;
  long long ans = 0;
  long long a = 1;
  while (2 * a <= x) a = 2 * a;
  for (long long i = l; i <= r; i++) ans += bool(x & (a / (i & -i)));
  cout << ans;
}
