#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  long long t;
  while (b) {
    a = a % b;
    t = a;
    a = b;
    b = t;
  }
  return a;
}
inline int gcd(int a, int b) {
  int t;
  while (b) {
    a = a % b;
    t = a;
    a = b;
    b = t;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long gcd(long long a, long long b, long long c) {
  return gcd(gcd(a, b), c);
}
inline int gcd(int a, int b, int c) { return gcd(gcd(a, b), c); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int p, csc, need;
  cin >> p >> csc >> need;
  for (int j = 0; csc - 50 * j >= need; j++) {
    int s = csc - 50 * j;
    int i = (s / 50) % 475;
    for (int k = 0; k < 25; k++) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  for (int j = 0; csc + 50 * j >= need; j++) {
    int s = csc + 50 * j;
    int i = (s / 50) % 475;
    for (int k = 0; k < 25; k++) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p) {
        if (j % 2 == 0) {
          cout << j / 2 << endl;
        } else {
          cout << j / 2 + 1 << endl;
        }
        return 0;
      }
    }
  }
  return 0;
}
