import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int Apoint = 0;
        int Bpoint = 0;
        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            
            int a = strA.compareTo(strB);
            int b = strB.compareTo(strA);
            	
            	if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                }
        }
        System.out.println(Apoint + " " + Bpoint);
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int Apoint = 0;
        int Bpoint = 0;
        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            
            int a = strA.compareTo(strB);
            int b = strB.compareTo(strA);
            	
            	if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                }
        }
        System.out.println(Apoint + " " + Bpoint);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int Apoint = 0;
        int Bpoint = 0;
        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            
            int a = strA.compareTo(strB);
            int b = strB.compareTo(strA);
            	
            	if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                }
        }
        System.out.println(Apoint + " " + Bpoint);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int Apoint = 0;
        int Bpoint = 0;
        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            
            int a = strA.compareTo(strB);
            int b = strB.compareTo(strA);
            	
            	if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                }
        }
        System.out.println(Apoint + " " + Bpoint);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int Apoint = 0; Apoint 0 int Bpoint = 0; Bpoint 0 for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            
            int a = strA.compareTo(strB);
            int b = strB.compareTo(strA);
            	
            	if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String strA = sc.next();
            String strB = sc.next();
            
            int a = strA.compareTo(strB);
            int b = strB.compareTo(strA);
            	
            	if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                }
        } {
            String strA = sc.next();
            String strB = sc.next();
            
            int a = strA.compareTo(strB);
            int b = strB.compareTo(strA);
            	
            	if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                }
        } String strA = sc.next(); strA sc.next() sc.next sc String strB = sc.next(); strB sc.next() sc.next sc int a = strA.compareTo(strB); a strA.compareTo(strB) strA.compareTo strA strB int b = strB.compareTo(strA); b strB.compareTo(strA) strB.compareTo strB strA if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                } a > b a b {
                    Apoint += 3;
                } Apoint += 3 Apoint 3 if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                } a < b a b {
                    Bpoint += 3;
                } Bpoint += 3 Bpoint 3 {
                    Apoint++;
                    Bpoint++;
                } Apoint++ Apoint Bpoint++ Bpoint System.out.println(Apoint + " " + Bpoint) System.out.println System.out System System.out Apoint + " " + Bpoint Apoint + " " + Bpoint Apoint " " Bpoint String[] args args
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int Apoint = 0;
        int Bpoint = 0;
        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            
            int a = strA.compareTo(strB);
            int b = strB.compareTo(strA);
            	
            	if(a > b){
                    Apoint += 3;
                }else if(a < b){
                    Bpoint += 3;
                }else{
                    Apoint++;
                    Bpoint++;
                }
        }
        System.out.println(Apoint + " " + Bpoint);
    }
}
