#include <bits/stdc++.h>
using namespace std;
int main() {
  int p, x, y;
  cin >> p >> x >> y;
  vector<int> opt;
  for (int i = 0; i < 475; i++) {
    int a = i;
    bool able = false;
    for (int j = 0; j < 25; j++) {
      a = (a * 96 + 42) % 475;
      if (a + 26 == p) {
        able = true;
        break;
      }
    }
    if (able) opt.push_back(i);
  }
  int sz = opt.size();
  int ans = 1000000;
  int got = x / 50;
  int low = y / 50;
  int pl = x % 50;
  if (y % 50 > 0) low++;
  for (int i = 0; i < sz; i++) {
    while (opt[i] * 50 + pl < y) opt[i] += 475;
    if (opt[i] <= got)
      ans = 0;
    else {
      int diff = opt[i] - got;
      if (diff % 2 == 1) diff++;
      ans = min(ans, diff / 2);
    }
  }
  printf("%d\n", ans);
}
