import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); int l = koko.nextInt(); int m = koko.nextInt(); int n = koko.nextInt(); int s = 100*l+25*m+n; int ms = s%1000; int mms = ms%100; int mmms = mms%25; System.out.println(((ms-mms)/100)+((mms-mmms)/25)+mmms); } }