#include using namespace std; int n, x, nr=0; bool ok; int main() { cin>>n; cin>>x; if(x=='1') ok=1; else ok=0; for(int i=1; i<=n-1; i++) { cin>>x; if(ok==1 and x!=0) nr++; if(ok==0 and x!=1) nr++; } cout << nr; return 0; }