#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n, long long m) {
  if (m == 0) {
    return n;
  }
  return gcd(m, n % m);
}
long long ans[4000];
int main(void) {
  long long n, l, r;
  long long ask = 0;
  cin >> n >> l >> r;
  if (n == 1) {
    cout << r - l + 1 << "\n";
  } else if (n == 2) {
    cout << (long long)(r - l + 1) * (long long)(r - l) << "\n";
  } else if (n > 25) {
    cout << "0\n";
  } else {
    int cn = 0;
    for (int i = 1; i <= 4000; i++) {
      long long sum = 1;
      int j;
      for (j = 0; j < n - 1; j++) {
        sum *= (long long)i;
        if (sum > r) {
          break;
        }
      }
      if (j == n - 1) {
        ans[++cn] = sum;
      } else {
        break;
      }
    }
    for (int i = 1; i <= cn; i++) {
      for (int j = i + 1; j <= cn; j++) {
        if (gcd(i, j) == 1) {
          long long p = r / ans[j];
          long long q = (l - 1) / ans[i];
          if (p >= q) {
            ask += p - q;
          }
        }
      }
    }
    cout << ask * 2LL << "\n";
  }
  return 0;
}
