bzoj#P1991. Pku2422 The Wolves and the Sheep

Pku2422 The Wolves and the Sheep

题目描述

草原上有 nn 只动物排成一列,用一个整数数组描述:00 表示狼,11 表示羊。求羊的数量。

输入格式

第一行一个整数 nn(1≤n≤1051\le n\le 10^5)。 第二行 nn 个整数 aia_i(ai∈{0,1}a_i\in\{0,1\})。

输出格式

输出一个整数,表示羊的数量。

样例输入

5
0 1 1 0 1

样例输出

3