#include <bits/stdc++.h>
using namespace std;
long long int i, j, n;
int main() {
  long long int pl, x, y;
  cin >> pl >> x >> y;
  long long int i = x / 50;
  i = i % 475;
  long long int p = 1;
  while (p <= 25) {
    i = (i * 96 + 42) % 475;
    if (26 + i == pl) {
      cout << 0;
      return 0;
    }
    p++;
  }
  for (j = x; j >= y; j -= 50) {
    i = j / 50;
    i %= 475;
    p = 1;
    while (p <= 25) {
      i = (i * 96 + 42) % 475;
      if (26 + i == pl) {
        cout << 0;
        return 0;
      }
      p++;
    }
  }
  for (j = x; j <= 200000; j += 50) {
    i = j / 50;
    i %= 475;
    p = 1;
    while (p <= 25) {
      i = (i * 96 + 42) % 475;
      if (26 + i == pl) {
        long long int t = j - x;
        long long int ans = ceil((1.0 * t) / 100);
        cout << ans;
        return 0;
      }
      p++;
    }
  }
  return 0;
}
