var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
Arr.shift();
var t=0;
var h=0;
Arr.forEach(function(v){
var arr=v.split(" ");
if(arr[0]==arr[1]){t++;h++;}
if(arr[0]>arr[1])t+=3;
if(arr[0]<arr[1])h+=3;
});
console.log(t+" "+h);