Glass Bead
InterviewTime limit1sMemory limit1024 MB
Given a 0/1 string of length N, find the maximum number of beads in the pyramid, where each bead needs the two beads below it.
Problem
It looks like a clear glass bead
But it will not break so easily
I love you, so you will not change
I will shine on you forever
You want to build a structure that does not break, using glass beads.
The structure is built by placing glass beads on the points of the pyramid grid below. ( are integers greater than or equal to )

To keep the structure from breaking at every point with , it must satisfy the following condition.
- A glass bead can be at only if there are glass beads at both and .
The information for the row of the structure is given. Place glass beads at points with as you see fit. Find the maximum number of glass beads the resulting structure can have.
Input
The first line contains the range .
The second line contains the information for the row of the structure as a string of length . If the -th character is 1, there is a glass bead at . Otherwise, there is no glass bead there. ()
There are no glass beads at outside the range ().
Output
Print the maximum number of glass beads in the structure on the first line.
Constraints
Hint
The answer can exceed the range of C++ int, so using the long long type is recommended.