#include <bits/stdc++.h>
using namespace std;
const long long maxll = 1e18;
const long long maxn = 1e5 + 1;
const long double eps = 0.0000001;
long long st(long long u) {
  long long p = 0;
  while (u % 2 == 0) {
    p++;
    u /= 2;
  }
  return p;
}
long long n, mask[52], b, c, ans, x = 10e12, y, z, m, k;
int main() {
  cin >> n >> m >> k;
  y = n;
  while (y != 0) {
    if (y % 2 == 1)
      mask[z] = 1;
    else
      mask[z] = 0;
    z++;
    y /= 2;
  }
  reverse(mask, mask + z);
  m--;
  k--;
  for (long long i = m; i <= k; i++) {
    if (mask[st(i + 1)] == 1) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
