#!/usr/bin/env python # -*- coding: utf-8 -*- def main(): l = int(input()) m = int(input()) n = int(input()) input_value = {1000:0, 100:l, 25:m, 1:n} output_value = {} rest = 0 for key, value in input_value.items(): rest += key * value for j in sorted([i for i in input_value.keys()], reverse=True): output_value[j] = rest // j rest = rest % j print(output_value[100] + output_value[25] + output_value[1]) if __name__ == '__main__': main()