#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int main() {
  int p, x, y;
  scanf("%d%d%d", &p, &x, &y);
  int jia = inf, jian = inf;
  for (int t = 0;; t += 50) {
    bool find = false;
    int i = ((x + t) / 50) % 475;
    for (int k = 1; k <= 25; k++) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p) {
        find = true;
        break;
      }
    }
    if (find) {
      jia = t;
      break;
    }
  }
  for (int t = -50; x + t >= y; t -= 50) {
    bool find = false;
    int i = ((x + t) / 50) % 475;
    for (int k = 1; k <= 25; k++) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p) {
        find = true;
        break;
      }
    }
    if (find) {
      jian = t;
      break;
    }
  }
  if (jian != inf)
    printf("0\n");
  else
    printf("%d\n", jia = (jia + 50) / 100);
}
