n=int(input()) F=[list(map(int,input().split())) for i in range(n)] DP=[0]*(1<