#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
string str;
int main() {
  int p, x, i, y, d, ini, flag = 0, s;
  scanf("%d%d%d", &p, &x, &y);
  d = (x - y) / 50;
  ini = x - d * 50;
  for (i = ini; i <= 2000000; i += 50) {
    s = (1.0 * i / 50);
    s = s % 475;
    for (int j = 0; j < 25; j++) {
      s = (s * 96 + 42) % 475;
      if ((26 + s) == p) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) break;
  }
  d = i - x;
  if (i > x)
    printf("%d\n", (int)ceil(1.0 * d / 100));
  else
    printf("0\n");
}
