# -*- coding: utf-8 -*- def main(): L = int(input()) M = int(input()) N = int(input()) print(L % 25 + ((M + (L // 25)) % 4) + ((N + ((M + (L // 25)) // 4)) % 10)) if __name__ == '__main__': main()