import java.io.*;

public class Main{
    public static void main(String[]args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] line;
        String a, b;
        int scoreOfA = 0;
        int scoreOfB = 0;

        for(int i = 0; i < n; i++){
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        }
        System.out.println(scoreOfA + " " + scoreOfB);
    }
} import java.io.*; io.* java public class Main{
    public static void main(String[]args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] line;
        String a, b;
        int scoreOfA = 0;
        int scoreOfB = 0;

        for(int i = 0; i < n; i++){
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        }
        System.out.println(scoreOfA + " " + scoreOfB);
    }
} Main public static void main(String[]args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] line;
        String a, b;
        int scoreOfA = 0;
        int scoreOfB = 0;

        for(int i = 0; i < n; i++){
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        }
        System.out.println(scoreOfA + " " + scoreOfB);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] line;
        String a, b;
        int scoreOfA = 0;
        int scoreOfB = 0;

        for(int i = 0; i < n; i++){
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        }
        System.out.println(scoreOfA + " " + scoreOfB);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] line; line String a a b; b int scoreOfA = 0; scoreOfA 0 int scoreOfB = 0; scoreOfB 0 for(int i = 0; i < n; i++){
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        } {
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        } line = br.readLine().split(" ") line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " a = line[0] a line[0] line 0 b = line[1] b line[1] line 1 if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            } a.compareTo(b) > 0 a.compareTo(b) a.compareTo a b 0 {
                scoreOfA += 3;
            } scoreOfA += 3 scoreOfA 3 if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            } a.compareTo(b) < 0 a.compareTo(b) a.compareTo a b 0 {
                scoreOfB += 3;
            } scoreOfB += 3 scoreOfB 3 {
                scoreOfA++;
                scoreOfB++;
            } scoreOfA++ scoreOfA scoreOfB++ scoreOfB System.out.println(scoreOfA + " " + scoreOfB) System.out.println System.out System System.out scoreOfA + " " + scoreOfB scoreOfA + " " + scoreOfB scoreOfA " " scoreOfB String[]args args public class Main{
    public static void main(String[]args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] line;
        String a, b;
        int scoreOfA = 0;
        int scoreOfB = 0;

        for(int i = 0; i < n; i++){
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        }
        System.out.println(scoreOfA + " " + scoreOfB);
    }
} public class Main{
    public static void main(String[]args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] line;
        String a, b;
        int scoreOfA = 0;
        int scoreOfB = 0;

        for(int i = 0; i < n; i++){
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        }
        System.out.println(scoreOfA + " " + scoreOfB);
    }
} Main
import java.io.*;

public class Main{
    public static void main(String[]args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] line;
        String a, b;
        int scoreOfA = 0;
        int scoreOfB = 0;

        for(int i = 0; i < n; i++){
            line = br.readLine().split(" ");
            a = line[0];
            b = line[1];

            if(a.compareTo(b) > 0){
                scoreOfA += 3;
            }else if(a.compareTo(b) < 0){
                scoreOfB += 3;
            }else{
                scoreOfA++;
                scoreOfB++;
            }
        }
        System.out.println(scoreOfA + " " + scoreOfB);
    }
}