const n = require("fs").readFileSync(0,"utf8").toString().trim().split("\n");
let cnt = 0;

for(let i=1; i<=Number(n[0]); i++){
    const s = n[i].replace(/(.)\1+/g, "$1");
    if(new Set(s).size === s.length) cnt++;
}

console.log(cnt);
