import java.io.*;

public class Main{
	public static void main(String[] arsg) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int a = 0, b = 0;
		for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		}
		System.out.println(a+" "+b);
	}
} import java.io.*; io.* java public class Main{
	public static void main(String[] arsg) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int a = 0, b = 0;
		for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		}
		System.out.println(a+" "+b);
	}
} Main public static void main(String[] arsg) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int a = 0, b = 0;
		for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		}
		System.out.println(a+" "+b);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int a = 0, b = 0;
		for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		}
		System.out.println(a+" "+b);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int a = 0 a 0 b = 0; b 0 for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		} int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		} {
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		} String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			} str[0].compareTo(str[1])>0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 a+=3 a 3 if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			} str[0].compareTo(str[1])<0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 b+=3 b 3 if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			} str[0].compareTo(str[1])==0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 {
			a++;
			b++;
			} a++ a b++ b System.out.println(a+" "+b) System.out.println System.out System System.out a+" "+b a+" "+b a " " b String[] arsg arsg public class Main{
	public static void main(String[] arsg) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int a = 0, b = 0;
		for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		}
		System.out.println(a+" "+b);
	}
} public class Main{
	public static void main(String[] arsg) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int a = 0, b = 0;
		for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		}
		System.out.println(a+" "+b);
	}
} Main
import java.io.*;

public class Main{
	public static void main(String[] arsg) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int a = 0, b = 0;
		for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		}
		System.out.println(a+" "+b);
	}
}