import java.io.IOException;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int taro = 0;
			int hanako = 0;
			
			for(int b=0;b<a;++b){
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
	}

} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int taro = 0;
			int hanako = 0;
			
			for(int b=0;b<a;++b){
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
	}

} Main public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int taro = 0;
			int hanako = 0;
			
			for(int b=0;b<a;++b){
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
	} main {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int taro = 0;
			int hanako = 0;
			
			for(int b=0;b<a;++b){
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int taro = 0; taro 0 int hanako = 0; hanako 0 for(int b=0;b<a;++b){
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			} int b=0; int b=0; b 0 b<a b a ++b ++b b {
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			} {
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			} String c = sc.next(); c sc.next() sc.next sc String d = sc.next(); d sc.next() sc.next sc int e ; e if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				} c.length()<d.length() c.length() c.length c d.length() d.length d {
					e=c.length();
				} e=c.length() e c.length() c.length c {
					e=d.length();
				} e=d.length() e d.length() d.length d for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				} int f=0; int f=0; f 0 f<e f e ++f ++f f {
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				} {
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				} char g = c.charAt(f); g c.charAt(f) c.charAt c f char h = d.charAt(f); h d.charAt(f) d.charAt d f if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					} g>h g h {
						taro += 3;
						break;
					} taro += 3 taro 3 break; if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					} g<h g h {
						hanako += 3;
						break;
					} hanako += 3 hanako 3 break; if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					} g==h g h {
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					} if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						} f==e-1 f e-1 e 1 {
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						} if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							} c.length()>d.length() c.length() c.length c d.length() d.length d {
								taro += 3;
							} taro += 3 taro 3 if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							} c.length()<d.length() c.length() c.length c d.length() d.length d {
								hanako += 3;
							} hanako += 3 hanako 3 {
								taro +=1;
								hanako +=1;
							} taro +=1 taro 1 hanako +=1 hanako 1 System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int taro = 0;
			int hanako = 0;
			
			for(int b=0;b<a;++b){
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
	}

} public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int taro = 0;
			int hanako = 0;
			
			for(int b=0;b<a;++b){
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
	}

} Main
import java.io.IOException;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int taro = 0;
			int hanako = 0;
			
			for(int b=0;b<a;++b){
				String c = sc.next();
				String d = sc.next();
				int e ;
				if(c.length()<d.length()){
					e=c.length();
				}else{
					e=d.length();
				}
				for(int f=0;f<e;++f){
					char g = c.charAt(f);
					char h = d.charAt(f);
					if(g>h){
						taro += 3;
						break;
					}else if(g<h){
						hanako += 3;
						break;
					}else if(g==h){
						if(f==e-1){
							if(c.length()>d.length()){
								taro += 3;
							}else if(c.length()<d.length()){
								hanako += 3;
							}else{
								taro +=1;
								hanako +=1;
							}
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
	}

}