import java.util.Scanner;

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

        int numOfGame = stdIn.nextInt();

        int taroScore = 0;
        int hanakoScore = 0;
        for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        }
        System.out.println(taroScore + " " + hanakoScore);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfGame = stdIn.nextInt();

        int taroScore = 0;
        int hanakoScore = 0;
        for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        }
        System.out.println(taroScore + " " + hanakoScore);
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfGame = stdIn.nextInt();

        int taroScore = 0;
        int hanakoScore = 0;
        for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        }
        System.out.println(taroScore + " " + hanakoScore);
    } main {
        Scanner stdIn = new Scanner(System.in);

        int numOfGame = stdIn.nextInt();

        int taroScore = 0;
        int hanakoScore = 0;
        for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        }
        System.out.println(taroScore + " " + hanakoScore);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int numOfGame = stdIn.nextInt(); numOfGame stdIn.nextInt() stdIn.nextInt stdIn int taroScore = 0; taroScore 0 int hanakoScore = 0; hanakoScore 0 for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        } int i = 0; int i = 0; i 0 i < numOfGame i numOfGame i++ i++ i {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        } {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        } String taroHand = stdIn.next(); taroHand stdIn.next() stdIn.next stdIn String hanakoHand = stdIn.next(); hanakoHand stdIn.next() stdIn.next stdIn int result = taroHand.compareTo(hanakoHand); result taroHand.compareTo(hanakoHand) taroHand.compareTo taroHand hanakoHand if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            } result > 0 result 0 {
                // taro win
                taroScore += 3;
            } taroScore += 3 taroScore 3 if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            } result < 0 result 0 {
                // hanako win
                hanakoScore += 3;
            } hanakoScore += 3 hanakoScore 3 {
                // draw
                taroScore++;
                hanakoScore++;
            } taroScore++ taroScore hanakoScore++ hanakoScore System.out.println(taroScore + " " + hanakoScore) System.out.println System.out System System.out taroScore + " " + hanakoScore taroScore + " " + hanakoScore taroScore " " hanakoScore String[] args args public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfGame = stdIn.nextInt();

        int taroScore = 0;
        int hanakoScore = 0;
        for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        }
        System.out.println(taroScore + " " + hanakoScore);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfGame = stdIn.nextInt();

        int taroScore = 0;
        int hanakoScore = 0;
        for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        }
        System.out.println(taroScore + " " + hanakoScore);
    }
} Main
import java.util.Scanner;

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

        int numOfGame = stdIn.nextInt();

        int taroScore = 0;
        int hanakoScore = 0;
        for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        }
        System.out.println(taroScore + " " + hanakoScore);
    }
}