• + 0 comments
    da, ma, ya = input().split(" ") #actual d, m, y
    de, me, ye = input().split(" ") #expected d, m, y
    
    dd, md, yd = int(da)-int(de), int(ma)-int(me), int(ya)-int(ye) #difference between actual and expected
    
    # funtion to calculate fine based on difference in d, m , y
    def calc_fine(d, m, y):
        if y > 0:
            return 10000
        elif y == 0:
            if m > 0:
                return 500 * m
            elif m == 0:
                if d > 0:
                    return 15 * d
    
        return 0
        
    print(calc_fine(dd, md, yd))