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

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        int n = Integer.parseInt(br.readLine());

        int taroPoint = 0;
        int hanakoPoint = 0;

        for(int i = 0; i < n; i++){

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        }
        sb.append(taroPoint).append(" ").append(hanakoPoint);
        System.out.println(sb);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        int n = Integer.parseInt(br.readLine());

        int taroPoint = 0;
        int hanakoPoint = 0;

        for(int i = 0; i < n; i++){

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        }
        sb.append(taroPoint).append(" ").append(hanakoPoint);
        System.out.println(sb);
    }
} Main public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        int n = Integer.parseInt(br.readLine());

        int taroPoint = 0;
        int hanakoPoint = 0;

        for(int i = 0; i < n; i++){

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        }
        sb.append(taroPoint).append(" ").append(hanakoPoint);
        System.out.println(sb);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        int n = Integer.parseInt(br.readLine());

        int taroPoint = 0;
        int hanakoPoint = 0;

        for(int i = 0; i < n; i++){

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        }
        sb.append(taroPoint).append(" ").append(hanakoPoint);
        System.out.println(sb);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int taroPoint = 0; taroPoint 0 int hanakoPoint = 0; hanakoPoint 0 for(int i = 0; i < n; i++){

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        } {

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        } String input = br.readLine(); input br.readLine() br.readLine br String[] card = input.split(" "); card input.split(" ") input.split input " " String taro = card[0]; taro card[0] card 0 String hanako = card[1]; hanako card[1] card 1 if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            } taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
                taroPoint += 3;
            } taroPoint += 3 taroPoint 3 if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            } taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
                hanakoPoint += 3;
            } hanakoPoint += 3 hanakoPoint 3 {
                taroPoint++;
                hanakoPoint++;
            } taroPoint++ taroPoint hanakoPoint++ hanakoPoint sb.append(taroPoint).append(" ").append(hanakoPoint) sb.append(taroPoint).append(" ").append sb.append(taroPoint).append(" ") sb.append(taroPoint).append sb.append(taroPoint) sb.append sb taroPoint " " hanakoPoint System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        int n = Integer.parseInt(br.readLine());

        int taroPoint = 0;
        int hanakoPoint = 0;

        for(int i = 0; i < n; i++){

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        }
        sb.append(taroPoint).append(" ").append(hanakoPoint);
        System.out.println(sb);
    }
} public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        int n = Integer.parseInt(br.readLine());

        int taroPoint = 0;
        int hanakoPoint = 0;

        for(int i = 0; i < n; i++){

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        }
        sb.append(taroPoint).append(" ").append(hanakoPoint);
        System.out.println(sb);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        int n = Integer.parseInt(br.readLine());

        int taroPoint = 0;
        int hanakoPoint = 0;

        for(int i = 0; i < n; i++){

            String input = br.readLine();
            String[] card = input.split(" ");

            String taro = card[0];
            String hanako = card[1];

            if(taro.compareTo(hanako) > 0){
                taroPoint += 3;
            }else if(taro.compareTo(hanako) < 0){
                hanakoPoint += 3;
            }else{
                taroPoint++;
                hanakoPoint++;
            }
        }
        sb.append(taroPoint).append(" ").append(hanakoPoint);
        System.out.println(sb);
    }
}