function main(input){
  input = input.split('\n');
  var result = 0;
  for(var i = 0;i < 3;i++){
    input[0] === input[1] && result++;
  }
  console.log(result);
}
main(require('fs').readFileSync('/dev/stdin','utf8'));