import java.util.Scanner;
class Main{
	public static void main(String[]args){
    
    	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int x=0,y=0;
            for(int i=0;i<n;i++){
                String s1=sc.next();
                String s2=sc.next();
                if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                }
            }
        System.out.println(x+" "+y);
	}
} 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 x=0,y=0;
            for(int i=0;i<n;i++){
                String s1=sc.next();
                String s2=sc.next();
                if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                }
            }
        System.out.println(x+" "+y);
	}
} Main public static void main(String[]args){
    
    	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int x=0,y=0;
            for(int i=0;i<n;i++){
                String s1=sc.next();
                String s2=sc.next();
                if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                }
            }
        System.out.println(x+" "+y);
	} main {
    
    	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int x=0,y=0;
            for(int i=0;i<n;i++){
                String s1=sc.next();
                String s2=sc.next();
                if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                }
            }
        System.out.println(x+" "+y);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int x=0 x 0 y=0; y 0 for(int i=0;i<n;i++){
                String s1=sc.next();
                String s2=sc.next();
                if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                }
            } int i=0; int i=0; i 0 i<n i n i++ i++ i {
                String s1=sc.next();
                String s2=sc.next();
                if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                }
            } {
                String s1=sc.next();
                String s2=sc.next();
                if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                }
            } String s1=sc.next(); s1 sc.next() sc.next sc String s2=sc.next(); s2 sc.next() sc.next sc if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                } s1.compareTo(s2)<0 s1.compareTo(s2) s1.compareTo s1 s2 0 {
                    y+=3;
                } y+=3 y 3 if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                } s1.compareTo(s2)>0 s1.compareTo(s2) s1.compareTo s1 s2 0 {
                    x+=3;
                } x+=3 x 3 {
                    x+=1;
                    y+=1;
                } x+=1 x 1 y+=1 y 1 System.out.println(x+" "+y) System.out.println System.out System System.out x+" "+y x+" "+y x " " y 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 x=0,y=0;
            for(int i=0;i<n;i++){
                String s1=sc.next();
                String s2=sc.next();
                if(s1.compareTo(s2)<0){
                    y+=3;
                }else if(s1.compareTo(s2)>0){
                    x+=3;
                }else{
                    x+=1;
                    y+=1;
                }
            }
        System.out.println(x+" "+y);
	}
}
