const input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/);
let time = Number(input[0])
let aCount = 0;
let bCount = 0;
for (let i=1; i<time+1; i++) {
  let [a, b] = input[i].split(/\s/);
  if(a < b) {
      bCount += 3;
    } else if(a > b) {
      aCount += 3;
    } else {
        aCount++;
        bCount++;
    }
}
 console.log(aCount + " " + bCount);

