#include <bits/stdc++.h>   using namespace std;   int p, x, y;   queue<int> q;   int mmap[100000];   bool check(int s) {     int i = s / 50 % 475;     for (int j = 0; j < 25; ++j) {       i = (i * 96 + 42) % 475;       if (26 + i == p) return true;     }     mmap[s] = 1;     return false;   }   int main() {     cin >> p >> x >> y;     q.push(0);     while (!q.empty()) {       int n = q.front();       q.pop();       int s = x + n * 100;       while (s >= y) {         if (mmap[s]) {           s -= 50;           continue;         }         if (check(s)) {           cout << n << endl;           return 0;         }         s -= 50;       }       q.push(n + 1);     }     return 0;   }   