Masha and Petya love eating pies. Their grandmother decided to delight them today by baking $$$n$$$ pies with cabbage and mushrooms. She prepared the dough, put the pies in the oven, and went to sleep. However, when it started smelling delicious, the grandchildren couldn't resist and decided to eat some of the pies. The pies are laid out in the oven in a single row from left to right. Masha wants to take every third pie, and Petya every seventh.
For example, Masha wants to take pies $$$3, 6, 9, 12, 15, 18, 21, 24$$$ and so on, while Petya wants $$$7, 14, 21, 28...$$$ The grandchildren take the pies in turns, starting from the left side of the oven. Masha starts first. If one of the grandchildren has already taken a pie with number $$$x$$$, then the other takes the next one. For instance, Petya will take the third pie with number $$$21$$$. Consequently, when Masha takes her seventh pie, she will take the pie with number $$$24$$$.
Since mushroom pies are tastier than cabbage pies, tell us how many mushroom pies each of the grandchildren will eat.
The first line contains the number of pies $$$n$$$ ($$$1 \le n \le 10^{5}$$$).
The next line specifies $$$n$$$ values $$$a_{i}$$$ ($$$0 \le a_{i} \le 1$$$) – if $$$0$$$, then the pie is with cabbage, otherwise with mushrooms.
Print two numbers separated by a space - the number of mushroom pies that Masha will eat, and then Petya.
71 1 0 1 0 1 1
1 1
241 0 1 1 1 0 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 0 1 1
5 2
11
0 0