#include <bits/stdc++.h>
using namespace std;
long long int ranks_per_score[40005][25];
void preCompute() {
  long long int i, j, x;
  for (i = 0; i < 40005; ++i) {
    x = ((i + 1) / 50) % 475;
    for (j = 0; j < 25; ++j) {
      x = (x * 96 + 42) % 475;
      ranks_per_score[i][j] = 26 + x;
    }
  }
}
long long int find_solution(long long int p, long long int x, long long int y) {
  long long int i, j;
  long long int score, diff;
  long long int min_ans = 10000, ans;
  long long int desired_score, d_score;
  for (i = 0; i < 40005; ++i) {
    score = i + 1;
    if (score >= y) {
      for (j = 0; j < 25; ++j) {
        ans = 100000;
        if (p == ranks_per_score[i][j]) {
          d_score = score;
          diff = d_score - x;
          if (diff < 0) {
            diff = -1 * diff;
            if (diff % 100 == 0 || diff % 50 == 0) ans = 0;
            if (ans < min_ans) {
              min_ans = ans;
              desired_score = d_score;
            }
          } else {
            if (diff % 100 == 0) {
              ans = diff / 100;
            } else if (diff % 50 == 0) {
              ans = diff / 100 + 1;
            }
            if (ans < min_ans) {
              min_ans = ans;
              desired_score = d_score;
            }
          }
        }
      }
    }
  }
  return min_ans;
}
int main() {
  preCompute();
  long long int p, x, y;
  cin >> p >> x >> y;
  long long int final_answer = find_solution(p, x, y);
  cout << final_answer << endl;
  return 0;
}
