import java.io.*;
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int taro = 0;
		int hanako = 0;
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		}
		System.out.println(taro + " " + hanako);
	}
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int taro = 0;
		int hanako = 0;
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		}
		System.out.println(taro + " " + hanako);
	}
} Main public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int taro = 0;
		int hanako = 0;
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		}
		System.out.println(taro + " " + hanako);
	} main { 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int taro = 0;
		int hanako = 0;
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		}
		System.out.println(taro + " " + hanako);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line1 = br.readLine(); line1 br.readLine() br.readLine br int n = Integer.parseInt(line1); n Integer.parseInt(line1) Integer.parseInt Integer line1 int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		} int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		} {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		} String line = br.readLine(); line br.readLine() br.readLine br String[] str = line.split(" "); str line.split(" ") line.split line " " if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			} str[0].compareToIgnoreCase(str[1]) > 0 str[0].compareToIgnoreCase(str[1]) str[0].compareToIgnoreCase str[0] str 0 str[1] str 1 0 {
				taro = taro + 3;
			} taro = taro + 3 taro taro + 3 taro 3 if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			} str[0].compareToIgnoreCase(str[1]) < 0 str[0].compareToIgnoreCase(str[1]) str[0].compareToIgnoreCase str[0] str 0 str[1] str 1 0 {
				hanako = hanako + 3;
			} hanako = hanako + 3 hanako hanako + 3 hanako 3 {
				taro++;
				hanako++;
			} taro++ taro hanako++ hanako 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 IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int taro = 0;
		int hanako = 0;
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		}
		System.out.println(taro + " " + hanako);
	}
} public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int taro = 0;
		int hanako = 0;
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

		}
		System.out.println(taro + " " + hanako);
	}
} Main
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int taro = 0;
		int hanako = 0;
		for (int i = 0; i<n ; i++ ) {
			String line = br.readLine();
			String[] str = line.split(" ");
			if (str[0].compareToIgnoreCase(str[1]) > 0) {
				taro = taro + 3;
			}else if (str[0].compareToIgnoreCase(str[1]) < 0){
				hanako = hanako + 3;
			}else{
				taro++;
				hanako++;
			}

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