def main():
    h = [int(input()) for count in range(5)]
    total_time = 0
    while len(h) > 0:
        dlist = []
        for i in range(len(h)):
            time = h[i]
            del_time = abs(round(time, -1) - time)
            dlist.append(del_time)
        min_d = dlist.index(min(dlist))
        total_time += h[min_d]
        if len(h) > 1:
            total_time = round(total_time, -1)
        h.pop(min_d)

    print(total_time)


if __name__ == '__main__':
    main()
