#include <bits/stdc++.h>
using namespace std;
int check(int p, int s) {
  int i = (s / 50) % 475;
  int ok = 0;
  for (int c = 0; c < 25; c++) {
    i = (i * 96 + 42) % 475;
    ok |= (p == 26 + i);
  }
  return ok;
}
int main() {
  int p, x, s;
  scanf("%d%d%d", &p, &x, &s);
  while (s % 50 != x % 50) {
    s++;
  }
  int ans = 0;
  int first = 1;
  while (s) {
    if (first != 1) {
      s += 100;
      if (check(p, s - 50)) {
        ans = (max(0, s - 50 - x) + 50) / 100;
        break;
      }
    }
    if (check(p, s)) {
      ans = ((max(0, s - x)) + 50) / 100;
      break;
    }
    first = 0;
  }
  printf("%d\n", ans);
}
