# -*- coding: utf-8 -*- import sys,math n=input() x=0 r=1 for i in range(0,n): y=input() x = y if i==0 else x r = r+1 if x