

import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String f,s;
        int a=0,b=0;
        for(int i = 0; i<n; i++)
        {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        }
        System.out.printf("%d %d\n",a,b);
    }
} 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();
        String f,s;
        int a=0,b=0;
        for(int i = 0; i<n; i++)
        {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        }
        System.out.printf("%d %d\n",a,b);
    }
} Main public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String f,s;
        int a=0,b=0;
        for(int i = 0; i<n; i++)
        {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        }
        System.out.printf("%d %d\n",a,b);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String f,s;
        int a=0,b=0;
        for(int i = 0; i<n; i++)
        {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        }
        System.out.printf("%d %d\n",a,b);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String f f s; s int a=0 a 0 b=0; b 0 for(int i = 0; i<n; i++)
        {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        } {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        } f = sc.next() f sc.next() sc.next sc s = sc.next() s sc.next() sc.next sc if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            } f.compareToIgnoreCase(s)<0 f.compareToIgnoreCase(s) f.compareToIgnoreCase f s 0 {
                b+=3;
            } b+=3 b 3 if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            } f.compareToIgnoreCase(s)>0 f.compareToIgnoreCase(s) f.compareToIgnoreCase f s 0 {
                a+=3;
            } a+=3 a 3 {
                a++;
                b++;
            } a++ a b++ b System.out.printf("%d %d\n",a,b) System.out.printf System.out System System.out "%d %d\n" a b String[] args args public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String f,s;
        int a=0,b=0;
        for(int i = 0; i<n; i++)
        {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        }
        System.out.printf("%d %d\n",a,b);
    }
} public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String f,s;
        int a=0,b=0;
        for(int i = 0; i<n; i++)
        {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        }
        System.out.printf("%d %d\n",a,b);
    }
} Main


import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String f,s;
        int a=0,b=0;
        for(int i = 0; i<n; i++)
        {
            f = sc.next();
            s = sc.next();
            if(f.compareToIgnoreCase(s)<0)
            {
                b+=3;
            }
            else if(f.compareToIgnoreCase(s)>0)
            {
                a+=3;
            }
            else
            {
                a++;
                b++;
            }
        }
        System.out.printf("%d %d\n",a,b);
    }
}
