#include <bits/stdc++.h>
int counter = 0;
int sosu[10000 + 1] = {0};
void makeTable(void);
void makeTable(void) {
  int i = 0;
  for (i = 2; i < 10000 + 1; i++) {
    if (sosu[i] == 0) {
      sosu[i] = 1;
      int j = 0;
      for (j = i * 2; j < 10000 + 1; j += i) {
        sosu[j] = -1;
      }
      counter++;
    }
  }
}
int main(int argc, char *argv[]) {
  int a = 0, b = 0, c = 0;
  int ans = 0;
  fscanf(stdin, "%d %d %d", &a, &b, &c);
  makeTable();
  int i = 0;
  for (i = a; i <= b; i++) {
    if (sosu[i] == 1) {
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
