import java.util.*;
import java.io.*;
 
class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int card = Integer.parseInt(br.readLine());    
        String[] str;
        int t=0;
        int h=0;
        for(int i=0; i<card; i++){
          
            str = br.readLine().split(" ");  
            String tarou = str[0];
            String hanako = str[1];

            int judge = tarou.compareTo(hanako);
             
            if(judge<0){        
                h += 3;   
            }else if(judge>0){  
                t += 3;   
            }else{              
                h += 1;   
                t += 1;
            }
        }
        System.out.println(t +" "+h);
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz