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

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int turn = Integer.parseInt(br.readLine());
        int taro=0,hanako=0;
        for(int i=0;i<turn;i++) {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        }
        System.out.println(taro + " " + hanako);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int turn = Integer.parseInt(br.readLine());
        int taro=0,hanako=0;
        for(int i=0;i<turn;i++) {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        }
        System.out.println(taro + " " + hanako);
    }
} Main public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int turn = Integer.parseInt(br.readLine());
        int taro=0,hanako=0;
        for(int i=0;i<turn;i++) {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        }
        System.out.println(taro + " " + hanako);
    } main {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int turn = Integer.parseInt(br.readLine());
        int taro=0,hanako=0;
        for(int i=0;i<turn;i++) {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        }
        System.out.println(taro + " " + hanako);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int turn = Integer.parseInt(br.readLine()); turn Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int taro=0 taro 0 hanako=0; hanako 0 for(int i=0;i<turn;i++) {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        } int i=0; int i=0; i 0 i<turn i turn i++ i++ i {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        } {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        } String[] line2 = br.readLine().split(" "); line2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            } line2[0].compareTo(line2[1]) == 0 line2[0].compareTo(line2[1]) line2[0].compareTo line2[0] line2 0 line2[1] line2 1 0 {
                taro++;
                hanako++;
            } taro++ taro hanako++ hanako if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            } line2[0].compareTo(line2[1]) > 0 line2[0].compareTo(line2[1]) line2[0].compareTo line2[0] line2 0 line2[1] line2 1 0 {
                taro += 3;
            } taro += 3 taro 3 {
                hanako += 3;
            } hanako += 3 hanako 3 System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int turn = Integer.parseInt(br.readLine());
        int taro=0,hanako=0;
        for(int i=0;i<turn;i++) {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        }
        System.out.println(taro + " " + hanako);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int turn = Integer.parseInt(br.readLine());
        int taro=0,hanako=0;
        for(int i=0;i<turn;i++) {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        }
        System.out.println(taro + " " + hanako);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int turn = Integer.parseInt(br.readLine());
        int taro=0,hanako=0;
        for(int i=0;i<turn;i++) {
            String[] line2 = br.readLine().split(" ");
            //引き分け
            if(line2[0].compareTo(line2[1]) == 0){
                taro++;
                hanako++;
            }
            else if(line2[0].compareTo(line2[1]) > 0){
                taro += 3;
            }
            else {
                hanako += 3;
            }
        }
        System.out.println(taro + " " + hanako);
    }
}