//Normal

#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

void print(auto a){
  cout << a;
}

void prints(auto a){
  cout << a << " ";
}

void prints(){
  cout << " ";
}

void printl(auto a){
  cout << a << endl;
}

void printl(){
  cout << endl;
}

void fix(int n){
  cout << fixed << setprecision(n);
}

int siz(string s){
  return (int)s.size();
}

int main(){
  int L, M, N; cin >> L >> M >> N;
  int sum = (L*100+M*25+N)%1000;
  vector<ll> X(sum+2000, 1e9);
  X[0] = 0;
  
  vector<int> Y = {1, 25, 100, 1000};
  for(int i = 0; i < sum; i++){
    for(int j = 0; j < 4; j++){
      X[i+Y[j]] = min(X[i+Y[j]], X[i]+1);
    }
  }
  
  printl(X[sum]);
  return 0;
}