import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int t=0;
        int h=0;
        for(int i=0;i<n;i++){
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        }
        System.out.println(t+" "+h);
    }
}
 import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int t=0;
        int h=0;
        for(int i=0;i<n;i++){
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        }
        System.out.println(t+" "+h);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int t=0;
        int h=0;
        for(int i=0;i<n;i++){
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        }
        System.out.println(t+" "+h);
    } main {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int t=0;
        int h=0;
        for(int i=0;i<n;i++){
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        }
        System.out.println(t+" "+h);
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int t=0; t 0 int h=0; h 0 for(int i=0;i<n;i++){
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        } {
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        } String Taro=sc.next(); Taro sc.next() sc.next sc String Hanako=sc.next(); Hanako sc.next() sc.next sc int result=Taro.compareTo(Hanako); result Taro.compareTo(Hanako) Taro.compareTo Taro Hanako if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            } result>0 result 0 t+=3 t 3 if(result<0) h+=3;
            else{
                t++;
                h++;
            } result<0 result 0 h+=3 h 3 {
                t++;
                h++;
            } t++ t h++ h System.out.println(t+" "+h) System.out.println System.out System System.out t+" "+h t+" "+h t " " h String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int t=0;
        int h=0;
        for(int i=0;i<n;i++){
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        }
        System.out.println(t+" "+h);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int t=0;
        int h=0;
        for(int i=0;i<n;i++){
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        }
        System.out.println(t+" "+h);
    }
} Main
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int t=0;
        int h=0;
        for(int i=0;i<n;i++){
            String Taro=sc.next();
            String Hanako=sc.next();
            int result=Taro.compareTo(Hanako);
            if(result>0) t+=3;
            else if(result<0) h+=3;
            else{
                t++;
                h++;
            }
        }
        System.out.println(t+" "+h);
    }
}

