import java.util.*;
 
class Main{
    public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		int taro = 0;
		int hanako = 0;
		while(cnt < n){
			String card1 = scan.next();
			String card2 = scan.next();

			if(card1.compareTo(card2) > 0){
				taro += 3;
			}
			else if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			}
			cnt++;
		}
		System.out.println(taro + " " + hanako);
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		int taro = 0;
		int hanako = 0;
		while(cnt < n){
			String card1 = scan.next();
			String card2 = scan.next();

			if(card1.compareTo(card2) > 0){
				taro += 3;
			}
			else if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			}
			cnt++;
		}
		System.out.println(taro + " " + hanako);
    }
} Main public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		int taro = 0;
		int hanako = 0;
		while(cnt < n){
			String card1 = scan.next();
			String card2 = scan.next();

			if(card1.compareTo(card2) > 0){
				taro += 3;
			}
			else if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			}
			cnt++;
		}
		System.out.println(taro + " " + hanako);
    } main {
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		int taro = 0;
		int hanako = 0;
		while(cnt < n){
			String card1 = scan.next();
			String card2 = scan.next();

			if(card1.compareTo(card2) > 0){
				taro += 3;
			}
			else if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			}
			cnt++;
		}
		System.out.println(taro + " " + hanako);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int cnt = 0; cnt 0 int taro = 0; taro 0 int hanako = 0; hanako 0 while(cnt < n){
			String card1 = scan.next();
			String card2 = scan.next();

			if(card1.compareTo(card2) > 0){
				taro += 3;
			}
			else if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			}
			cnt++;
		} cnt < n cnt n {
			String card1 = scan.next();
			String card2 = scan.next();

			if(card1.compareTo(card2) > 0){
				taro += 3;
			}
			else if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			}
			cnt++;
		} String card1 = scan.next(); card1 scan.next() scan.next scan String card2 = scan.next(); card2 scan.next() scan.next scan if(card1.compareTo(card2) > 0){
				taro += 3;
			}
			else if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			} card1.compareTo(card2) > 0 card1.compareTo(card2) card1.compareTo card1 card2 0 {
				taro += 3;
			} taro += 3 taro 3 if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			} card1.compareTo(card2) < 0 card1.compareTo(card2) card1.compareTo card1 card2 0 {
				hanako += 3;
			} hanako += 3 hanako 3 {
				taro += 1;
				hanako += 1;
			} taro += 1 taro 1 hanako += 1 hanako 1 cnt++ cnt System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args
import java.util.*;
 
class Main{
    public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		int taro = 0;
		int hanako = 0;
		while(cnt < n){
			String card1 = scan.next();
			String card2 = scan.next();

			if(card1.compareTo(card2) > 0){
				taro += 3;
			}
			else if(card1.compareTo(card2) < 0){
				hanako += 3;
			}
			else{
				taro += 1;
				hanako += 1;
			}
			cnt++;
		}
		System.out.println(taro + " " + hanako);
    }
}