#include<stdio.h>int main() { long c = 0; long ch = 0; long chn = 0; char arr[8000] = {0}; char* p = arr; gets(arr); while(*p) { if(*p == 'C') c++; else if(*p == 'H') ch = ch + c; else if(*p == 'N') chn = chn + ch; p++; } printf("%ld",chn); return 0; }