import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n, judge, taro = 0, hanako = 0;
		String s, s2;
		
		n = sc.nextInt();
		
		for(int i = 0; i < n; i++){
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		}
		
		System.out.println(taro + " " + hanako);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n, judge, taro = 0, hanako = 0;
		String s, s2;
		
		n = sc.nextInt();
		
		for(int i = 0; i < n; i++){
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		}
		
		System.out.println(taro + " " + hanako);
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n, judge, taro = 0, hanako = 0;
		String s, s2;
		
		n = sc.nextInt();
		
		for(int i = 0; i < n; i++){
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		}
		
		System.out.println(taro + " " + hanako);
	} main {
		Scanner sc = new Scanner(System.in);
		int n, judge, taro = 0, hanako = 0;
		String s, s2;
		
		n = sc.nextInt();
		
		for(int i = 0; i < n; i++){
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		}
		
		System.out.println(taro + " " + hanako);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n n judge judge taro = 0 taro 0 hanako = 0; hanako 0 String s s s2; s2 n = sc.nextInt() n sc.nextInt() sc.nextInt sc for(int i = 0; i < n; i++){
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		} {
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		} s = sc.next() s sc.next() sc.next sc s2 = sc.next() s2 sc.next() sc.next sc judge = s.compareTo(s2) judge s.compareTo(s2) s.compareTo s s2 if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			} judge < 0 judge 0 hanako += 3 hanako 3 if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			} judge > 0 judge 0 taro += 3 taro 3 {
				taro ++;
				hanako ++;
			} taro ++ taro hanako ++ hanako 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[]){
		Scanner sc = new Scanner(System.in);
		int n, judge, taro = 0, hanako = 0;
		String s, s2;
		
		n = sc.nextInt();
		
		for(int i = 0; i < n; i++){
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		}
		
		System.out.println(taro + " " + hanako);
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n, judge, taro = 0, hanako = 0;
		String s, s2;
		
		n = sc.nextInt();
		
		for(int i = 0; i < n; i++){
			s = sc.next();
			s2 = sc.next();
			
			judge = s.compareTo(s2);
			
			if(judge < 0)
				hanako += 3;
			else if(judge > 0)
				taro += 3;
			else{
				taro ++;
				hanako ++;
			}
		}
		
		System.out.println(taro + " " + hanako);
	}
} Main
import java.util.*;

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