import java.util.Scanner;

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

public class Main {
 
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int i,n,a=0,b=0;
        String s1,s2;
        n=sc.nextInt();
        
        for(i=0;i<n;i++) {
            s1=sc.next();
            s2=sc.next();
            
            if(s1.compareTo(s2)>0) {
                a+=3;
            }
            else if(s1.compareTo(s2)<0) {
                b+=3;
            }
            else if(s1.compareTo(s2)==0) {
                a+=1;
                b+=1;
            }
        }
        System.out.println(a+" "+b);
        
        sc.close();
    }
}

