import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int scoreT = 0, scoreH = 0;
            for(int i = 0; i < num; i++){
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            }
            System.out.println(scoreT +" "+ scoreH);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int scoreT = 0, scoreH = 0;
            for(int i = 0; i < num; i++){
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            }
            System.out.println(scoreT +" "+ scoreH);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int scoreT = 0, scoreH = 0;
            for(int i = 0; i < num; i++){
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            }
            System.out.println(scoreT +" "+ scoreH);
    } main {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int scoreT = 0, scoreH = 0;
            for(int i = 0; i < num; i++){
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            }
            System.out.println(scoreT +" "+ scoreH);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int scoreT = 0 scoreT 0 scoreH = 0; scoreH 0 for(int i = 0; i < num; i++){
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            } {
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            } String strT = sc.next(); strT sc.next() sc.next sc String strH = sc.next(); strH sc.next() sc.next sc if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3; (strT.compareTo(strH)) == 0 (strT.compareTo(strH)) strT.compareTo strT strH 0 {
                    scoreT += 1;
                    scoreH += 1;
                } scoreT += 1 scoreT 1 scoreH += 1 scoreH 1 if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3; (strT.compareTo(strH)) > 0 (strT.compareTo(strH)) strT.compareTo strT strH 0 {
                    scoreT += 3;
                } scoreT += 3 scoreT 3 scoreH += 3 scoreH 3 System.out.println(scoreT +" "+ scoreH) System.out.println System.out System System.out scoreT +" "+ scoreH scoreT +" "+ scoreH scoreT " " scoreH String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int scoreT = 0, scoreH = 0;
            for(int i = 0; i < num; i++){
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            }
            System.out.println(scoreT +" "+ scoreH);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int scoreT = 0, scoreH = 0;
            for(int i = 0; i < num; i++){
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            }
            System.out.println(scoreT +" "+ scoreH);
    }
} Main
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int scoreT = 0, scoreH = 0;
            for(int i = 0; i < num; i++){
                String strT = sc.next();
                String strH = sc.next();
                if((strT.compareTo(strH)) == 0){
                    scoreT += 1;
                    scoreH += 1;
                }
                else if((strT.compareTo(strH)) > 0){
                    scoreT += 3;
                }
                else scoreH += 3;
            }
            System.out.println(scoreT +" "+ scoreH);
    }
}
