import java.io.IOException;
import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    public static void main(String[] Args) throws IOException{
        final int n = Integer.parseInt(sc.next());
        int taro = 0, hanako = 0;
        for(int i = 0; i<n; i++){
            final String tc = sc.next();
            final String hc = sc.next();
            final int judge = tc.compareTo(hc);
            if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            }
        }
        System.out.println(taro+" "+hanako);
    }
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util class Main{
    private static final Scanner sc = new Scanner(System.in);
    public static void main(String[] Args) throws IOException{
        final int n = Integer.parseInt(sc.next());
        int taro = 0, hanako = 0;
        for(int i = 0; i<n; i++){
            final String tc = sc.next();
            final String hc = sc.next();
            final int judge = tc.compareTo(hc);
            if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            }
        }
        System.out.println(taro+" "+hanako);
    }
} Main private static final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] Args) throws IOException{
        final int n = Integer.parseInt(sc.next());
        int taro = 0, hanako = 0;
        for(int i = 0; i<n; i++){
            final String tc = sc.next();
            final String hc = sc.next();
            final int judge = tc.compareTo(hc);
            if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            }
        }
        System.out.println(taro+" "+hanako);
    } main {
        final int n = Integer.parseInt(sc.next());
        int taro = 0, hanako = 0;
        for(int i = 0; i<n; i++){
            final String tc = sc.next();
            final String hc = sc.next();
            final int judge = tc.compareTo(hc);
            if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            }
        }
        System.out.println(taro+" "+hanako);
    } final int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int taro = 0 taro 0 hanako = 0; hanako 0 for(int i = 0; i<n; i++){
            final String tc = sc.next();
            final String hc = sc.next();
            final int judge = tc.compareTo(hc);
            if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            }
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            final String tc = sc.next();
            final String hc = sc.next();
            final int judge = tc.compareTo(hc);
            if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            }
        } {
            final String tc = sc.next();
            final String hc = sc.next();
            final int judge = tc.compareTo(hc);
            if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            }
        } final String tc = sc.next(); tc sc.next() sc.next sc final String hc = sc.next(); hc sc.next() sc.next sc final int judge = tc.compareTo(hc); judge tc.compareTo(hc) tc.compareTo tc hc if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            } judge<0 judge 0 hanako += 3 hanako 3 if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            } judge>0 judge 0 taro += 3 taro 3 {
                taro++;
                hanako++;
            } taro++ taro hanako++ hanako System.out.println(taro+" "+hanako) System.out.println System.out System System.out taro+" "+hanako taro+" "+hanako taro " " hanako String[] Args Args
import java.io.IOException;
import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    public static void main(String[] Args) throws IOException{
        final int n = Integer.parseInt(sc.next());
        int taro = 0, hanako = 0;
        for(int i = 0; i<n; i++){
            final String tc = sc.next();
            final String hc = sc.next();
            final int judge = tc.compareTo(hc);
            if(judge<0) hanako += 3;
            else if(judge>0) taro += 3;
            else{
                taro++;
                hanako++;
            }
        }
        System.out.println(taro+" "+hanako);
    }
}