#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 100;
const int max1 = 1e5 + 100;
void solve() {
  int n, p, m, k, z, y, x;
  scanf("%d", &p);
  scanf("%d", &x);
  scanf("%d", &y);
  int ans = 0;
  while (x < y) {
    x += 100;
    ans++;
  }
  for (int z = 0; z <= max1; z++) {
    for (int l = 0; l <= maxn; l++) {
      n = x + 100 * z - 50 * l;
      if (n < y) break;
      int j = (n / 50) % 475;
      for (int i = 1; i <= 25; i++) {
        j = (j * 96 + 42) % 475;
        if ((j + 26) == p) {
          printf("%d\n", ans + z);
          return;
        }
      }
    }
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
