import java.util.Scanner;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int scoreTarou = 0;
		int scoreHanako = 0;
		String tarouWord = null;
		String hanakoWord = null;

		for(int i = 0; i < n;i++){
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		}
		System.out.printf("%d %d\n", scoreTarou, scoreHanako);
	}
}
 import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int scoreTarou = 0;
		int scoreHanako = 0;
		String tarouWord = null;
		String hanakoWord = null;

		for(int i = 0; i < n;i++){
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		}
		System.out.printf("%d %d\n", scoreTarou, scoreHanako);
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int scoreTarou = 0;
		int scoreHanako = 0;
		String tarouWord = null;
		String hanakoWord = null;

		for(int i = 0; i < n;i++){
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		}
		System.out.printf("%d %d\n", scoreTarou, scoreHanako);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int scoreTarou = 0;
		int scoreHanako = 0;
		String tarouWord = null;
		String hanakoWord = null;

		for(int i = 0; i < n;i++){
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		}
		System.out.printf("%d %d\n", scoreTarou, scoreHanako);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int scoreTarou = 0; scoreTarou 0 int scoreHanako = 0; scoreHanako 0 String tarouWord = null; tarouWord null String hanakoWord = null; hanakoWord null for(int i = 0; i < n;i++){
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		} {
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		} tarouWord = sc.next() tarouWord sc.next() sc.next sc hanakoWord = sc.next() hanakoWord sc.next() sc.next sc if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			} tarouWord.compareTo(hanakoWord) < 0 tarouWord.compareTo(hanakoWord) tarouWord.compareTo tarouWord hanakoWord 0 {
				scoreHanako += 3;
			} scoreHanako += 3 scoreHanako 3 if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			} 0 < tarouWord.compareTo(hanakoWord) 0 tarouWord.compareTo(hanakoWord) tarouWord.compareTo tarouWord hanakoWord {
				scoreTarou += 3;
			} scoreTarou += 3 scoreTarou 3 {
				scoreTarou ++;
				scoreHanako ++;
			} scoreTarou ++ scoreTarou scoreHanako ++ scoreHanako System.out.printf("%d %d\n", scoreTarou, scoreHanako) System.out.printf System.out System System.out "%d %d\n" scoreTarou scoreHanako String args[] args public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int scoreTarou = 0;
		int scoreHanako = 0;
		String tarouWord = null;
		String hanakoWord = null;

		for(int i = 0; i < n;i++){
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		}
		System.out.printf("%d %d\n", scoreTarou, scoreHanako);
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int scoreTarou = 0;
		int scoreHanako = 0;
		String tarouWord = null;
		String hanakoWord = null;

		for(int i = 0; i < n;i++){
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		}
		System.out.printf("%d %d\n", scoreTarou, scoreHanako);
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int scoreTarou = 0;
		int scoreHanako = 0;
		String tarouWord = null;
		String hanakoWord = null;

		for(int i = 0; i < n;i++){
			tarouWord = sc.next();
			hanakoWord = sc.next();
			if(tarouWord.compareTo(hanakoWord) < 0){
				scoreHanako += 3;
			}else if( 0 < tarouWord.compareTo(hanakoWord)){
				scoreTarou += 3;
			}else{
				scoreTarou ++;
				scoreHanako ++;
			}
		}
		System.out.printf("%d %d\n", scoreTarou, scoreHanako);
	}
}

