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