import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int taroPoint = 0;
        int hanakoPoint = 0;
        scanner.nextLine();
        
        for(int i=1;i<=n;i++){
            String input = scanner.nextLine();
            String inputArr[] = input.split(" ");
            int check = inputArr[0].compareTo(inputArr[1]);
            if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            }
        }
        System.out.println(Integer.toString(taroPoint) + " " + Integer.toString(hanakoPoint));
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int taroPoint = 0;
        int hanakoPoint = 0;
        scanner.nextLine();
        
        for(int i=1;i<=n;i++){
            String input = scanner.nextLine();
            String inputArr[] = input.split(" ");
            int check = inputArr[0].compareTo(inputArr[1]);
            if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            }
        }
        System.out.println(Integer.toString(taroPoint) + " " + Integer.toString(hanakoPoint));
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int taroPoint = 0;
        int hanakoPoint = 0;
        scanner.nextLine();
        
        for(int i=1;i<=n;i++){
            String input = scanner.nextLine();
            String inputArr[] = input.split(" ");
            int check = inputArr[0].compareTo(inputArr[1]);
            if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            }
        }
        System.out.println(Integer.toString(taroPoint) + " " + Integer.toString(hanakoPoint));
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int taroPoint = 0;
        int hanakoPoint = 0;
        scanner.nextLine();
        
        for(int i=1;i<=n;i++){
            String input = scanner.nextLine();
            String inputArr[] = input.split(" ");
            int check = inputArr[0].compareTo(inputArr[1]);
            if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            }
        }
        System.out.println(Integer.toString(taroPoint) + " " + Integer.toString(hanakoPoint));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int taroPoint = 0; taroPoint 0 int hanakoPoint = 0; hanakoPoint 0 scanner.nextLine() scanner.nextLine scanner for(int i=1;i<=n;i++){
            String input = scanner.nextLine();
            String inputArr[] = input.split(" ");
            int check = inputArr[0].compareTo(inputArr[1]);
            if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            }
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            String input = scanner.nextLine();
            String inputArr[] = input.split(" ");
            int check = inputArr[0].compareTo(inputArr[1]);
            if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            }
        } {
            String input = scanner.nextLine();
            String inputArr[] = input.split(" ");
            int check = inputArr[0].compareTo(inputArr[1]);
            if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            }
        } String input = scanner.nextLine(); input scanner.nextLine() scanner.nextLine scanner String inputArr[] = input.split(" "); inputArr input.split(" ") input.split input " " int check = inputArr[0].compareTo(inputArr[1]); check inputArr[0].compareTo(inputArr[1]) inputArr[0].compareTo inputArr[0] inputArr 0 inputArr[1] inputArr 1 if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            } check > 0 check 0 {
                taroPoint += 3;
            } taroPoint += 3 taroPoint 3 if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            } check == 0 check 0 {
                taroPoint += 1;
                hanakoPoint += 1;
            } taroPoint += 1 taroPoint 1 hanakoPoint += 1 hanakoPoint 1 {
                hanakoPoint += 3;
            } hanakoPoint += 3 hanakoPoint 3 System.out.println(Integer.toString(taroPoint) + " " + Integer.toString(hanakoPoint)) System.out.println System.out System System.out Integer.toString(taroPoint) + " " + Integer.toString(hanakoPoint) Integer.toString(taroPoint) + " " + Integer.toString(hanakoPoint) Integer.toString(taroPoint) Integer.toString Integer taroPoint " " Integer.toString(hanakoPoint) Integer.toString Integer hanakoPoint String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int taroPoint = 0;
        int hanakoPoint = 0;
        scanner.nextLine();
        
        for(int i=1;i<=n;i++){
            String input = scanner.nextLine();
            String inputArr[] = input.split(" ");
            int check = inputArr[0].compareTo(inputArr[1]);
            if(check > 0){
                taroPoint += 3;
            } else if(check == 0){
                taroPoint += 1;
                hanakoPoint += 1;
            } else {
                hanakoPoint += 3;
            }
        }
        System.out.println(Integer.toString(taroPoint) + " " + Integer.toString(hanakoPoint));
    }
}
