L. Lantern Festival
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
7
1 0 1 1 0 0 1
Output
4
Input
5
0 1 0 0 1
Output
2