"use strict";
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

var re = /\s+|$/;
reader.on('close', () => {
    let l = lines.shift();
    const n = Number(l.trim());
    let ss=[]
    for (var i=0; i<n; i++) {
	l = lines.shift();
	ss.push(l.trim().split(re))
    }

    console.log(aux(ss).map(x=>x.toString()).join(' '));
});

function aux(ss)
{
    let p0=0;
    let p1=0;
    while (ss.length > 0) {
	let s = ss.shift();
	if (s[0] > s[1]) {
	    p0 += 3;
	} else if (s[0] < s[1]) {
	    p1 += 3;
	} else {
	    p0 += 1;
	    p1 += 1;
	}
    }

    return [p0,p1];
}
