LearnPy Hub
← Arena
IntermediateRating 1300

Holiday Plan

Each day you do one of three activities A, B or C, earning the points given for that day. You may not do the same activity two days in a row. Print the most points possible.

Input

n; then n lines 'a b c'.

Output

One integer.

Sample 1

Input
3
10 40 70
20 50 80
30 60 90
Output
210

Sample 2

Input
1
100 10 1
Output
100
solution.py
Output appears here
Holiday Plan · Python Arena problem · LearnPy Hub