The counter does not increase at all so I want to know which part went wrong.
#include <cstring>
#include <iostream>
using namespace std;
            
int main(){
   int total=0,na=0,ni=0;//use to count how much type of element is there
   string chem;
   getline(cin,chem);
   for(int i=0;i!='\0';i++){
       if(chem[i]=='N'){
           if(chem[i+1]=='i'){
               ni++;
           }else{
              na++;
              cout<<na<<endl;
        }
    }
}
na and total values are both 0
cout<<na<<endl;
total=total + ni+na;
cout<<total;
 
    