the Smart Beaver ABBYY decide day but day turn boring decide play game pebble Initially Beaver n pebble he arrange equal row row b pebble a1 note Beaver use pebble e nab 10 pebble arrange row row 5 pebble once Smart Beaver arrange pebble take result row b pebble discard pebble then arrange pebble possibly choose value b take row the game continue point Beaver end exactly pebble the game process represent finite sequence integer c1ck c1n ci1 number pebble Beaver end ith number pebble row arrangement ci pebble 1ik Note cici1 ck1 the result game sum number ci you give n find maximum possible result game