#include using namespace std; int main(){ int N; cin>>N; vector A(N); for(int &i:A)cin>>i; while(A[--N]==0); for(int i=1;i