#include <bits/stdc++.h>
using namespace std;
int p, x, y;
int vis[555];
void cal(int s) {
  int i = (s / 50) % 475;
  for (int j = 1; j < (26); j++) {
    i = (i * 96 + 42) % 475;
    vis[i + 26] = 1;
  }
}
int main() {
  scanf("%d %d %d", &p, &x, &y);
  int tmpx = x;
  while (x - 50 >= y) x -= 50;
  int sum = 0, cnt2 = 0;
  while (1) {
    memset(vis, 0, sizeof(vis));
    cal(x);
    if (vis[p] == 1) {
      printf("%d\n", 0);
      return 0;
    }
    x += 50;
    if (tmpx <= x) break;
  }
  sum = 0;
  x = tmpx;
  while (1) {
    memset(vis, 0, sizeof(vis));
    cal(x);
    if (vis[p] == 1) {
      printf("%d\n", cnt2);
      return 0;
    } else {
      x += 50;
      sum += 50;
      if (sum % 100 == 50) cnt2++;
    }
  }
}
