$a = trim(fgets(STDIN)); $b = trim(fgets(STDIN)); $c = trim(fgets(STDIN)); $not = 0; for($i = 0; $i < $a; $i++) { if($b[$a]!=$c[$a]) { $not++; } } echo $not.PHP_EOL;