import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.nextLine());
		int taro = 0;
		int hana = 0;

		for(int i=0; i<n; i++){
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		}
		System.out.println(taro+" "+hana);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.nextLine());
		int taro = 0;
		int hana = 0;

		for(int i=0; i<n; i++){
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		}
		System.out.println(taro+" "+hana);
	}
} Main public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.nextLine());
		int taro = 0;
		int hana = 0;

		for(int i=0; i<n; i++){
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		}
		System.out.println(taro+" "+hana);
	} main {
		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.nextLine());
		int taro = 0;
		int hana = 0;

		for(int i=0; i<n; i++){
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		}
		System.out.println(taro+" "+hana);
	} Scanner std = new Scanner(System.in); std new Scanner(System.in) int n = Integer.parseInt(std.nextLine()); n Integer.parseInt(std.nextLine()) Integer.parseInt Integer std.nextLine() std.nextLine std int taro = 0; taro 0 int hana = 0; hana 0 for(int i=0; i<n; i++){
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		} {
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		} String taroline = std.next(); taroline std.next() std.next std String hanaline = std.next(); hanaline std.next() std.next std if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;} taroline.compareTo(hanaline)<0 taroline.compareTo(hanaline) taroline.compareTo taroline hanaline 0 {hana+=3;} hana+=3 hana 3 if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;} taroline.compareTo(hanaline)==0 taroline.compareTo(hanaline) taroline.compareTo taroline hanaline 0 {hana++; taro++;} hana++ hana taro++ taro if(taroline.compareTo(hanaline)>0){taro+=3;} taroline.compareTo(hanaline)>0 taroline.compareTo(hanaline) taroline.compareTo taroline hanaline 0 {taro+=3;} taro+=3 taro 3 System.out.println(taro+" "+hana) System.out.println System.out System System.out taro+" "+hana taro+" "+hana taro " " hana String[] args args public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.nextLine());
		int taro = 0;
		int hana = 0;

		for(int i=0; i<n; i++){
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		}
		System.out.println(taro+" "+hana);
	}
} public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.nextLine());
		int taro = 0;
		int hana = 0;

		for(int i=0; i<n; i++){
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		}
		System.out.println(taro+" "+hana);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.nextLine());
		int taro = 0;
		int hana = 0;

		for(int i=0; i<n; i++){
			String taroline = std.next();
			String hanaline = std.next();
			if(taroline.compareTo(hanaline)<0){hana+=3;}
			else if(taroline.compareTo(hanaline)==0){hana++; taro++;}
			else if(taroline.compareTo(hanaline)>0){taro+=3;}
		}
		System.out.println(taro+" "+hana);
	}
}