import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String taro, hanako, str;
        int st=0, sh=0;
        int n = scan.nextInt();
        for(int i=0; i<n; i++) {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String taro, hanako, str;
        int st=0, sh=0;
        int n = scan.nextInt();
        for(int i=0; i<n; i++) {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String taro, hanako, str;
        int st=0, sh=0;
        int n = scan.nextInt();
        for(int i=0; i<n; i++) {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    } main {
        Scanner scan = new Scanner(System.in);
        String taro, hanako, str;
        int st=0, sh=0;
        int n = scan.nextInt();
        for(int i=0; i<n; i++) {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String taro taro hanako hanako str; str int st=0 st 0 sh=0; sh 0 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for(int i=0; i<n; i++) {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        } {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        } taro = scan.next() taro scan.next() scan.next scan hanako = scan.next() hanako scan.next() scan.next scan if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; } taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 sh += 3 sh 3 if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; } taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 st+=3 st 3 { st++; sh++; } st++ st sh++ sh System.out.println(st + " " + sh) System.out.println System.out System System.out st + " " + sh st + " " + sh st " " sh String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String taro, hanako, str;
        int st=0, sh=0;
        int n = scan.nextInt();
        for(int i=0; i<n; i++) {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String taro, hanako, str;
        int st=0, sh=0;
        int n = scan.nextInt();
        for(int i=0; i<n; i++) {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String taro, hanako, str;
        int st=0, sh=0;
        int n = scan.nextInt();
        for(int i=0; i<n; i++) {
            taro = scan.next();
            hanako = scan.next();
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    }
}