#include <bits/stdc++.h>
using namespace std;
int func(int s, int pos, int bound) {
  if (s < bound) return false;
  int i = (s / 50) % 475;
  for (int k = 0; k < 25; k++) {
    i = (i * 96 + 42) % 475;
    if (26 + i == pos) return true;
  }
  if (s - 50 >= bound) {
    s = s - 50;
    i = (s / 50) % 475;
    for (int k = 0; k < 25; k++) {
      i = (i * 96 + 42) % 475;
      if (26 + i == pos) return true;
    }
  }
  return false;
}
int main() {
  long long int ans = 0, flag = 1;
  int s, pos, bound;
  scanf("%d %d %d", &pos, &s, &bound);
  for (int i = 0;; i++) {
    if (s - 50 * i < bound)
      break;
    else if (func(s - i * 50, pos, bound)) {
      printf("0\n");
      return 0;
    }
  }
  for (int i = 0;; i++) {
    if (func(s + i * 100, pos, bound)) {
      printf("%d\n", i);
      break;
    }
  }
  return 0;
}
