#include int main(void){ int L,M,N,L1,M1,N1; scanf("%d%d%d",&L,&M,&N); N1 = (N%25); M1 = ((M+N/25)%4); L1 = ((L+M/4)%10); printf("%d\n",L1+M1+N1); return 0; }