#include <bits/stdc++.h>
using namespace std;
int main() {
  long long p, x, y, k, a, i, b;
  cin >> p >> x >> y;
  k = 0;
  if (y > x) {
    k = (y - x) / 100;
    x += k * 100;
    if (x < y) {
      k++;
      if (x + 50 >= y)
        x += 50;
      else
        x += 100;
    }
  }
  a = x;
  for (; x >= y; x -= 50) {
    i = (x / 50) % 475;
    b = 25;
    while (b--) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p) {
        cout << k;
        return 0;
      }
    }
  }
  x = a;
  while (1) {
    k++;
    x += 50;
    i = (x / 50) % 475;
    b = 25;
    while (b--) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p) {
        cout << k;
        return 0;
      }
    }
    x += 50;
    i = (x / 50) % 475;
    b = 25;
    while (b--) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p) {
        cout << k;
        return 0;
      }
    }
  }
  return 0;
}
