import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int time = sc.nextInt();
        int score1 = 0, score2 = 0;

        for(int i = 0; i < time; i++){
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        }

        System.out.println(score1 + " " + score2);

        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 time = sc.nextInt();
        int score1 = 0, score2 = 0;

        for(int i = 0; i < time; i++){
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        }

        System.out.println(score1 + " " + score2);

        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int time = sc.nextInt();
        int score1 = 0, score2 = 0;

        for(int i = 0; i < time; i++){
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        }

        System.out.println(score1 + " " + score2);

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int time = sc.nextInt();
        int score1 = 0, score2 = 0;

        for(int i = 0; i < time; i++){
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        }

        System.out.println(score1 + " " + score2);

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int time = sc.nextInt(); time sc.nextInt() sc.nextInt sc int score1 = 0 score1 0 score2 = 0; score2 0 for(int i = 0; i < time; i++){
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        } int i = 0; int i = 0; i 0 i < time i time i++ i++ i {
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        } {
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        } String p1 = sc.next(); p1 sc.next() sc.next sc String p2 = sc.next(); p2 sc.next() sc.next sc if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3; p1.compareToIgnoreCase(p2) < 0 p1.compareToIgnoreCase(p2) p1.compareToIgnoreCase p1 p2 0 score2 += 3 score2 3 if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3; p1.compareToIgnoreCase(p2) == 0 p1.compareToIgnoreCase(p2) p1.compareToIgnoreCase p1 p2 0 {
                score1++;
                score2++;
            } score1++ score1 score2++ score2 score1 += 3 score1 3 System.out.println(score1 + " " + score2) System.out.println System.out System System.out score1 + " " + score2 score1 + " " + score2 score1 " " score2 sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int time = sc.nextInt();
        int score1 = 0, score2 = 0;

        for(int i = 0; i < time; i++){
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        }

        System.out.println(score1 + " " + score2);

        sc.close();
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int time = sc.nextInt();
        int score1 = 0, score2 = 0;

        for(int i = 0; i < time; i++){
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        }

        System.out.println(score1 + " " + score2);

        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int time = sc.nextInt();
        int score1 = 0, score2 = 0;

        for(int i = 0; i < time; i++){
            String p1 = sc.next();
            String p2 = sc.next();

            if(p1.compareToIgnoreCase(p2) < 0)
                score2 += 3;
            else if(p1.compareToIgnoreCase(p2) == 0){
                score1++;
                score2++;
            }
            else
                score1 += 3;
        }

        System.out.println(score1 + " " + score2);

        sc.close();
    }
}

