import java.util.*;
import java.io.*;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = s.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		}
		s.close();
		System.out.println(tarou + " " + hanako);
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = s.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		}
		s.close();
		System.out.println(tarou + " " + hanako);
	}
} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = s.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		}
		s.close();
		System.out.println(tarou + " " + hanako);
	} main {
		Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = s.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		}
		s.close();
		System.out.println(tarou + " " + hanako);
	} Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in))); s new Scanner(new BufferedReader(new InputStreamReader(System.in))) String turn = s.next(); turn s.next() s.next s Integer tarou = 0; tarou 0 Integer hanako = 0; hanako 0 for(int i = 0; i < Integer.parseInt(turn); i++){
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		} int i = 0; int i = 0; i 0 i < Integer.parseInt(turn) i Integer.parseInt(turn) Integer.parseInt Integer turn i++ i++ i {
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		} {
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		} String tarou_card = s.next(); tarou_card s.next() s.next s String hanako_card = s.next(); hanako_card s.next() s.next s Integer result = tarou_card.compareTo(hanako_card); result tarou_card.compareTo(hanako_card) tarou_card.compareTo tarou_card hanako_card if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			} result == 0 result 0 {
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			} if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			} tarou_card.equals(hanako_card) tarou_card.equals tarou_card hanako_card {
				tarou += 1;
				hanako += 1;
			} tarou += 1 tarou 1 hanako += 1 hanako 1 if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			} result > 0 result 0 {
				tarou += 3;
			} tarou += 3 tarou 3 {
				hanako += 3;
			} hanako += 3 hanako 3 s.close() s.close s System.out.println(tarou + " " + hanako) System.out.println System.out System System.out tarou + " " + hanako tarou + " " + hanako tarou " " hanako String[] args args public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = s.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		}
		s.close();
		System.out.println(tarou + " " + hanako);
	}
} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = s.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		}
		s.close();
		System.out.println(tarou + " " + hanako);
	}
} Main
import java.util.*;
import java.io.*;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String turn = s.next();
		Integer tarou = 0;
		Integer hanako = 0;
		for(int i = 0; i < Integer.parseInt(turn); i++){
			String tarou_card = s.next();
			String hanako_card = s.next();
			Integer result = tarou_card.compareTo(hanako_card);
			if(result == 0){
			if(tarou_card.equals(hanako_card)){
				tarou += 1;
				hanako += 1;
			}
			}
			else if(result > 0){
				tarou += 3;
			}
			else{
				hanako += 3;
			}
		}
		s.close();
		System.out.println(tarou + " " + hanako);
	}
}