import java.util.*;
import java.io.*;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner br = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = br.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		}
		System.out.println(tarou + " " + hanako);
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner br = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = br.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		}
		System.out.println(tarou + " " + hanako);
	}
} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner br = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = br.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		}
		System.out.println(tarou + " " + hanako);
	} main {
		Scanner br = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = br.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		}
		System.out.println(tarou + " " + hanako);
	} Scanner br = new Scanner(new BufferedReader(new InputStreamReader(System.in))); br new Scanner(new BufferedReader(new InputStreamReader(System.in))) String turn = br.next(); turn br.next() br.next br Integer tarou = 0; tarou 0 Integer hanako = 0; hanako 0 for(int i = 0; i < Integer.parseInt(turn); i++){
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		} int i = 0; int i = 0; i 0 i < Integer.parseInt(turn) i Integer.parseInt(turn) Integer.parseInt Integer turn i++ i++ i {
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		} {
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		} String[] battle = {br.next(), br.next()}; battle {br.next(), br.next()} br.next() br.next br br.next() br.next br String[] battle_bkp = battle.clone(); battle_bkp battle.clone() battle.clone battle Arrays.sort(battle) Arrays.sort Arrays battle if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			} battle[0].equals(battle[1]) battle[0].equals battle[0] battle 0 battle[1] battle 1 {
				tarou += 1;
				hanako += 1;
			} tarou += 1 tarou 1 hanako += 1 hanako 1 if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			} battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1]) battle[0].equals(battle_bkp[0]) battle[0].equals battle[0] battle 0 battle_bkp[0] battle_bkp 0 battle[1].equals(battle_bkp[1]) battle[1].equals battle[1] battle 1 battle_bkp[1] battle_bkp 1 {
				hanako += 3;
			} hanako += 3 hanako 3 {
				tarou += 3;
			} tarou += 3 tarou 3 System.out.println(tarou + " " + hanako) System.out.println System.out System System.out tarou + " " + hanako tarou + " " + hanako tarou " " hanako String[] args args public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner br = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = br.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		}
		System.out.println(tarou + " " + hanako);
	}
} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner br = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = br.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		}
		System.out.println(tarou + " " + hanako);
	}
} Main
import java.util.*;
import java.io.*;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner br = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = br.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String[] battle = {br.next(), br.next()};
			String[] battle_bkp = battle.clone();
			Arrays.sort(battle);
			if(battle[0].equals(battle[1])){
				tarou += 1;
				hanako += 1;
			}
			else if(battle[0].equals(battle_bkp[0]) && battle[1].equals(battle_bkp[1])){
				hanako += 3;
			}
			else{
				tarou += 3;
			}
		}
		System.out.println(tarou + " " + hanako);
	}
}