import java.util.*;
import java.util.stream.*;
class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n,taro,hanako;
        taro = 0;
        hanako = 0;
        n = input.nextInt();
        String a,b;
        for (int i = 0; i < n; i++){
            a = input.next();
            b = input.next();
            int key = a.compareTo(b);
            if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.printf("%d %d\n",taro,hanako);
    }
} import java.util.*; util.* java import java.util.stream.*; stream.* java.util class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n,taro,hanako;
        taro = 0;
        hanako = 0;
        n = input.nextInt();
        String a,b;
        for (int i = 0; i < n; i++){
            a = input.next();
            b = input.next();
            int key = a.compareTo(b);
            if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.printf("%d %d\n",taro,hanako);
    }
} Main public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n,taro,hanako;
        taro = 0;
        hanako = 0;
        n = input.nextInt();
        String a,b;
        for (int i = 0; i < n; i++){
            a = input.next();
            b = input.next();
            int key = a.compareTo(b);
            if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.printf("%d %d\n",taro,hanako);
    } main {
        Scanner input = new Scanner(System.in);
        int n,taro,hanako;
        taro = 0;
        hanako = 0;
        n = input.nextInt();
        String a,b;
        for (int i = 0; i < n; i++){
            a = input.next();
            b = input.next();
            int key = a.compareTo(b);
            if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.printf("%d %d\n",taro,hanako);
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) int n n taro taro hanako; hanako taro = 0 taro 0 hanako = 0 hanako 0 n = input.nextInt() n input.nextInt() input.nextInt input String a a b; b for (int i = 0; i < n; i++){
            a = input.next();
            b = input.next();
            int key = a.compareTo(b);
            if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a = input.next();
            b = input.next();
            int key = a.compareTo(b);
            if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            }
        } {
            a = input.next();
            b = input.next();
            int key = a.compareTo(b);
            if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            }
        } a = input.next() a input.next() input.next input b = input.next() b input.next() input.next input int key = a.compareTo(b); key a.compareTo(b) a.compareTo a b if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            } key > 0 key 0 {
                taro += 3;
            } taro += 3 taro 3 if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            } key < 0 key 0 {
                hanako += 3;
            } hanako += 3 hanako 3 {
                taro += 1;
                hanako += 1;
            } taro += 1 taro 1 hanako += 1 hanako 1 System.out.printf("%d %d\n",taro,hanako) System.out.printf System.out System System.out "%d %d\n" taro hanako String[] args args
import java.util.*;
import java.util.stream.*;
class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n,taro,hanako;
        taro = 0;
        hanako = 0;
        n = input.nextInt();
        String a,b;
        for (int i = 0; i < n; i++){
            a = input.next();
            b = input.next();
            int key = a.compareTo(b);
            if (key > 0){
                taro += 3;
            } else if (key < 0){
                hanako += 3;
            } else {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.printf("%d %d\n",taro,hanako);
    }
}
