import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = 0, h = 0;
        int num = Integer.parseInt(br.readLine());

        for (int i = 0; i < num; i++) {
            String n = br.readLine();
            String taro = n.substring(0, n.indexOf(' '));
            String hanako = n.substring(n.indexOf(' ') + 1);

            if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            }
        }
        System.out.println(t + " " + h);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = 0, h = 0;
        int num = Integer.parseInt(br.readLine());

        for (int i = 0; i < num; i++) {
            String n = br.readLine();
            String taro = n.substring(0, n.indexOf(' '));
            String hanako = n.substring(n.indexOf(' ') + 1);

            if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            }
        }
        System.out.println(t + " " + h);
    }
} Main public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = 0, h = 0;
        int num = Integer.parseInt(br.readLine());

        for (int i = 0; i < num; i++) {
            String n = br.readLine();
            String taro = n.substring(0, n.indexOf(' '));
            String hanako = n.substring(n.indexOf(' ') + 1);

            if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            }
        }
        System.out.println(t + " " + h);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = 0, h = 0;
        int num = Integer.parseInt(br.readLine());

        for (int i = 0; i < num; i++) {
            String n = br.readLine();
            String taro = n.substring(0, n.indexOf(' '));
            String hanako = n.substring(n.indexOf(' ') + 1);

            if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            }
        }
        System.out.println(t + " " + h);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int t = 0 t 0 h = 0; h 0 int num = Integer.parseInt(br.readLine()); num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < num; i++) {
            String n = br.readLine();
            String taro = n.substring(0, n.indexOf(' '));
            String hanako = n.substring(n.indexOf(' ') + 1);

            if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            }
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            String n = br.readLine();
            String taro = n.substring(0, n.indexOf(' '));
            String hanako = n.substring(n.indexOf(' ') + 1);

            if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            }
        } {
            String n = br.readLine();
            String taro = n.substring(0, n.indexOf(' '));
            String hanako = n.substring(n.indexOf(' ') + 1);

            if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            }
        } String n = br.readLine(); n br.readLine() br.readLine br String taro = n.substring(0, n.indexOf(' ')); taro n.substring(0, n.indexOf(' ')) n.substring n 0 n.indexOf(' ') n.indexOf n ' ' String hanako = n.substring(n.indexOf(' ') + 1); hanako n.substring(n.indexOf(' ') + 1) n.substring n n.indexOf(' ') + 1 n.indexOf(' ') n.indexOf n ' ' 1 if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            } (taro.compareTo (hanako)) == 0 (taro.compareTo (hanako)) taro.compareTo taro hanako 0 {
                t++;
                h++;
            } t++ t h++ h if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            } (taro.compareTo(hanako) > 0) taro.compareTo(hanako) taro.compareTo taro hanako 0 {
                t += 3;
            } t += 3 t 3 if((taro.compareTo(hanako) < 0)) {
                h += 3;
            } (taro.compareTo(hanako) < 0) taro.compareTo(hanako) taro.compareTo taro hanako 0 {
                h += 3;
            } h += 3 h 3 System.out.println(t + " " + h) System.out.println System.out System System.out t + " " + h t + " " + h t " " h String args[] args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = 0, h = 0;
        int num = Integer.parseInt(br.readLine());

        for (int i = 0; i < num; i++) {
            String n = br.readLine();
            String taro = n.substring(0, n.indexOf(' '));
            String hanako = n.substring(n.indexOf(' ') + 1);

            if ((taro.compareTo (hanako)) == 0) {
                t++;
                h++;
            } else if((taro.compareTo(hanako) > 0)) {
                t += 3;
            } else if((taro.compareTo(hanako) < 0)) {
                h += 3;
            }
        }
        System.out.println(t + " " + h);
    }
}