import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int taro=0,hanako=0;
		String tcard,hcard;
		for(int i=0;i<n;i++){
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		}
		System.out.printf("%d %d\n",taro,hanako);
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int taro=0,hanako=0;
		String tcard,hcard;
		for(int i=0;i<n;i++){
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		}
		System.out.printf("%d %d\n",taro,hanako);
		scan.close();
	}
} Main public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int taro=0,hanako=0;
		String tcard,hcard;
		for(int i=0;i<n;i++){
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		}
		System.out.printf("%d %d\n",taro,hanako);
		scan.close();
	} main {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int taro=0,hanako=0;
		String tcard,hcard;
		for(int i=0;i<n;i++){
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		}
		System.out.printf("%d %d\n",taro,hanako);
		scan.close();
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan int taro=0 taro 0 hanako=0; hanako 0 String tcard tcard hcard; hcard for(int i=0;i<n;i++){
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		} {
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		} tcard=scan.next() tcard scan.next() scan.next scan hcard=scan.next() hcard scan.next() scan.next scan if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			} tcard.compareTo(hcard)<0 tcard.compareTo(hcard) tcard.compareTo tcard hcard 0 {
				hanako+=3;
			} hanako+=3 hanako 3 if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			} 0<tcard.compareTo(hcard) 0 tcard.compareTo(hcard) tcard.compareTo tcard hcard {
				taro+=3;
			} taro+=3 taro 3 {
				hanako+=1;
				taro+=1;
			} hanako+=1 hanako 1 taro+=1 taro 1 System.out.printf("%d %d\n",taro,hanako) System.out.printf System.out System System.out "%d %d\n" taro hanako scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int taro=0,hanako=0;
		String tcard,hcard;
		for(int i=0;i<n;i++){
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		}
		System.out.printf("%d %d\n",taro,hanako);
		scan.close();
	}
} public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int taro=0,hanako=0;
		String tcard,hcard;
		for(int i=0;i<n;i++){
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		}
		System.out.printf("%d %d\n",taro,hanako);
		scan.close();
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int taro=0,hanako=0;
		String tcard,hcard;
		for(int i=0;i<n;i++){
			tcard=scan.next();
			hcard=scan.next();
			if(tcard.compareTo(hcard)<0){
				hanako+=3;
			}else if(0<tcard.compareTo(hcard)){
				taro+=3;
			}else{
				hanako+=1;
				taro+=1;
			}
		}
		System.out.printf("%d %d\n",taro,hanako);
		scan.close();
	}
}