import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int n = 0;
		int taroPoint = 0;
		int hanakoPoint= 0;
		String str =null;
		ArrayList<String> taro = new ArrayList<String>();
		ArrayList<String> hanako = new ArrayList<String>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int j = 0; j < n; ++j){
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		}
		for(int a = 0; a < n; ++a){
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			}
		System.out.println(taroPoint+" "+hanakoPoint);
		sc.close();
	}

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

	public static void main(String[] args) {
		int n = 0;
		int taroPoint = 0;
		int hanakoPoint= 0;
		String str =null;
		ArrayList<String> taro = new ArrayList<String>();
		ArrayList<String> hanako = new ArrayList<String>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int j = 0; j < n; ++j){
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		}
		for(int a = 0; a < n; ++a){
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			}
		System.out.println(taroPoint+" "+hanakoPoint);
		sc.close();
	}

} Main public static void main(String[] args) {
		int n = 0;
		int taroPoint = 0;
		int hanakoPoint= 0;
		String str =null;
		ArrayList<String> taro = new ArrayList<String>();
		ArrayList<String> hanako = new ArrayList<String>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int j = 0; j < n; ++j){
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		}
		for(int a = 0; a < n; ++a){
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			}
		System.out.println(taroPoint+" "+hanakoPoint);
		sc.close();
	} main {
		int n = 0;
		int taroPoint = 0;
		int hanakoPoint= 0;
		String str =null;
		ArrayList<String> taro = new ArrayList<String>();
		ArrayList<String> hanako = new ArrayList<String>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int j = 0; j < n; ++j){
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		}
		for(int a = 0; a < n; ++a){
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			}
		System.out.println(taroPoint+" "+hanakoPoint);
		sc.close();
	} int n = 0; n 0 int taroPoint = 0; taroPoint 0 int hanakoPoint= 0; hanakoPoint 0 String str =null; str null ArrayList<String> taro = new ArrayList<String>(); taro new ArrayList<String>() ArrayList<String> hanako = new ArrayList<String>(); hanako new ArrayList<String>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc for(int j = 0; j < n; ++j){
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		} int j = 0; int j = 0; j 0 j < n j n ++j ++j j {
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		} {
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		} for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			} int i = 0; int i = 0; i 0 i < 2 i 2 ++i ++i i {
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			} {
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			} str = sc.next() str sc.next() sc.next sc if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str); i == 0 i 0 taro.add(str) taro.add taro str if(i == 1)
					hanako.add(str); i == 1 i 1 hanako.add(str) hanako.add hanako str for(int a = 0; a < n; ++a){
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			} int a = 0; int a = 0; a 0 a < n a n ++a ++a a {
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			} {
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			} int comp = (taro.get(a)).compareTo(hanako.get(a)); comp (taro.get(a)).compareTo(hanako.get(a)) (taro.get(a)).compareTo (taro.get(a)) taro.get taro a hanako.get(a) hanako.get hanako a if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			} comp < 0 comp 0 {
				hanakoPoint += 3;
			} hanakoPoint += 3 hanakoPoint 3 if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			} comp > 0 comp 0 {
				taroPoint += 3;
			} taroPoint += 3 taroPoint 3 {
				hanakoPoint += 1;
				taroPoint += 1;
			} hanakoPoint += 1 hanakoPoint 1 taroPoint += 1 taroPoint 1 System.out.println(taroPoint+" "+hanakoPoint) System.out.println System.out System System.out taroPoint+" "+hanakoPoint taroPoint+" "+hanakoPoint taroPoint " " hanakoPoint sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		int n = 0;
		int taroPoint = 0;
		int hanakoPoint= 0;
		String str =null;
		ArrayList<String> taro = new ArrayList<String>();
		ArrayList<String> hanako = new ArrayList<String>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int j = 0; j < n; ++j){
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		}
		for(int a = 0; a < n; ++a){
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			}
		System.out.println(taroPoint+" "+hanakoPoint);
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		int n = 0;
		int taroPoint = 0;
		int hanakoPoint= 0;
		String str =null;
		ArrayList<String> taro = new ArrayList<String>();
		ArrayList<String> hanako = new ArrayList<String>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int j = 0; j < n; ++j){
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		}
		for(int a = 0; a < n; ++a){
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			}
		System.out.println(taroPoint+" "+hanakoPoint);
		sc.close();
	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int n = 0;
		int taroPoint = 0;
		int hanakoPoint= 0;
		String str =null;
		ArrayList<String> taro = new ArrayList<String>();
		ArrayList<String> hanako = new ArrayList<String>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int j = 0; j < n; ++j){
			for(int i = 0; i < 2; ++i){
				str = sc.next();
				if(i == 0)
				taro.add(str);
				else if(i == 1)
					hanako.add(str);
			}
		}
		for(int a = 0; a < n; ++a){
			int comp = (taro.get(a)).compareTo(hanako.get(a));
			if(comp < 0){
				hanakoPoint += 3;
			}
			else if(comp > 0){
				taroPoint += 3;
			}
			else{
				hanakoPoint += 1;
				taroPoint += 1;
			}
			}
		System.out.println(taroPoint+" "+hanakoPoint);
		sc.close();
	}

}