#include <bits/stdc++.h>
using namespace std;
int p, x, y, mark, pos;
int main() {
  scanf("%d %d %d", &p, &x, &y);
  int i = 0;
  while (true) {
    mark = x + i * 100;
    while (mark >= y) {
      pos = (mark / 50) % 475;
      for (int j = 1; j <= 25; j++) {
        pos = (pos * 96 + 42) % 475;
        if (pos + 26 == p) {
          printf("%d\n", i);
          return 0;
        }
      }
      mark -= 50;
    }
    i++;
  }
}
