import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        }
        sc.close();

        System.out.println(taro +" "+hanako);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        }
        sc.close();

        System.out.println(taro +" "+hanako);
    }

} Main public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        }
        sc.close();

        System.out.println(taro +" "+hanako);
    } main {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        }
        sc.close();

        System.out.println(taro +" "+hanako);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i = 0; i < n; i++) {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        } {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        } String str1 = sc.next(); str1 sc.next() sc.next sc String str2 = sc.next(); str2 sc.next() sc.next sc int result = str1.compareTo(str2); result str1.compareTo(str2) str1.compareTo str1 str2 if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            } result == 0 result 0 {
                taro++;
                hanako++;
            } taro++ taro hanako++ hanako if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            } result < 0 result 0 {
                hanako += 3;
            } hanako += 3 hanako 3 {
                taro += 3;
            } taro += 3 taro 3 sc.close() sc.close sc 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 {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        }
        sc.close();

        System.out.println(taro +" "+hanako);
    }

} public class Main {

    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        }
        sc.close();

        System.out.println(taro +" "+hanako);
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String str1 = sc.next();
            String str2 = sc.next();
            int result = str1.compareTo(str2);
            if(result == 0) {
                taro++;
                hanako++;
            }else if(result < 0){
                hanako += 3;
            }else{
                taro += 3;
            }
        }
        sc.close();

        System.out.println(taro +" "+hanako);
    }

}