N = int(input()) A, B, C = [], [], [] for i in range(N): a, b, c = list(map(int, input().split())) A.append(a) B.append(b) C.append(c) def minTime(A, B, C, N): dp = [[float('inf'), float('inf')] for i in range(N+1)] dp[0] = [float('inf'), 0] for i in range(1, N+1): dp[i][0] = min(dp[i-1][0], dp[i-1][1] + C[i-1]) + A[i-1] dp[i][1] = min(dp[i-1][1], dp[i-1][0] + C[i-1]) + B[i-1] return min(dp[N]) print(minTime(A,B,C,N))