Energy Tycoon#6264

Energy Tycoon

1 sekunt
128 megabaýt
Orta

Little Vasya is playing a new computer game — turn-based strategy "Energy Tycoon".

The rules of the game are quite simple:

prb6264

Vasya already knows the types of power plant he will be able to build each turn. Now he wants to know, what the maximum possible score he can get is. Can you help him?

Giriş

The first line of the input contains one integer (1 \le n \le 10^5) - the number of slots on the board. The second line contains the string . The -th character of the string is if you can build one-slot power plant at the -th turn and the character is if you can build two-slot power plant at the -th turn. The number of turns does not exceed 10^5.

Çykyş

The output should contain a single integer - the maximal score that can be achieved.

Mysallar

1-nji mysal

Loading
Loading

2-nji mysal

Loading
Loading

3-nji mysal

Loading
Loading