import java.util.Scanner;

public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int tPoint = 0;
		int hPoint = 0;
		for(int i = 0;i < n; i++){
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		}
		System.out.println(tPoint + " " + hPoint);
	}
	public static void main(String args[]){
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int tPoint = 0;
		int hPoint = 0;
		for(int i = 0;i < n; i++){
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		}
		System.out.println(tPoint + " " + hPoint);
	}
	public static void main(String args[]){
		new Main().run();
	}
} Main void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int tPoint = 0;
		int hPoint = 0;
		for(int i = 0;i < n; i++){
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		}
		System.out.println(tPoint + " " + hPoint);
	} run {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int tPoint = 0;
		int hPoint = 0;
		for(int i = 0;i < n; i++){
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		}
		System.out.println(tPoint + " " + hPoint);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int tPoint = 0; tPoint 0 int hPoint = 0; hPoint 0 for(int i = 0;i < n; i++){
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		} {
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		} String taro = s.next(); taro s.next() s.next s String hana = s.next(); hana s.next() s.next s if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			} taro.compareTo(hana) < 0 taro.compareTo(hana) taro.compareTo taro hana 0 {
				hPoint += 3;
			} hPoint += 3 hPoint 3 if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			} taro.compareTo(hana) > 0 taro.compareTo(hana) taro.compareTo taro hana 0 {
				tPoint += 3;
			} tPoint += 3 tPoint 3 {
				tPoint++;
				hPoint++;
			} tPoint++ tPoint hPoint++ hPoint System.out.println(tPoint + " " + hPoint) System.out.println System.out System System.out tPoint + " " + hPoint tPoint + " " + hPoint tPoint " " hPoint public static void main(String args[]){
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String args[] args public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int tPoint = 0;
		int hPoint = 0;
		for(int i = 0;i < n; i++){
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		}
		System.out.println(tPoint + " " + hPoint);
	}
	public static void main(String args[]){
		new Main().run();
	}
} public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int tPoint = 0;
		int hPoint = 0;
		for(int i = 0;i < n; i++){
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		}
		System.out.println(tPoint + " " + hPoint);
	}
	public static void main(String args[]){
		new Main().run();
	}
} Main
import java.util.Scanner;

public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int tPoint = 0;
		int hPoint = 0;
		for(int i = 0;i < n; i++){
			String taro = s.next();
			String hana = s.next();
			if(taro.compareTo(hana) < 0){
				hPoint += 3;
			}else if(taro.compareTo(hana) > 0){
				tPoint += 3;
			}else{
				tPoint++;
				hPoint++;
			}
		}
		System.out.println(tPoint + " " + hPoint);
	}
	public static void main(String args[]){
		new Main().run();
	}
}