import java.io.PrintStream;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * Solution to
 * 
 * @author vanb
 */
public class curling_vanb
{
    /** Input. */
    private static Scanner sc;
    
    /** Output. */
    private static PrintStream ps;
    
    private int[] readLine()
    {
        int count = sc.nextInt();
        int distances[] = new int[count];
        for( int i=0; i<count; i++ )
        {
            int x = sc.nextInt();
            int y = sc.nextInt();
            int dx = x-144;
            int dy = y-84;
            distances[i] = dx*dx + dy*dy;
        }
        
        Arrays.sort( distances )
        ;
        return distances;
    }
    
    /**
     * Do it!
     */
    private void doit()
    {
        int redScore = 0;
        int yellowScore = 0;
        
        for( int i=0; i<10; i++ )
        {
           int redStones[] = readLine();
           int yellowStones[] = readLine();
           
           if( redStones.length>0 )
           {
               if( yellowStones.length>0 )
               {
                   if( redStones[0] < yellowStones[0] )
                   {
                       for( int stone : redStones )
                       {
                           if( stone < yellowStones[0] ) ++redScore;
                       }
                   }
                   else
                   {
                       for( int stone : yellowStones )
                       {
                           if( stone < redStones[0] ) ++yellowScore;
                       }                       
                   }
               }
               else redScore += redStones.length;
           }
           else yellowScore += yellowStones.length;
        }
        
        ps.println( redScore + " " + yellowScore );
    }
        
    /**
     * Main.
     * 
     * @param args unused
     * @throws Exception
     */
    public static void main( String[] args ) throws Exception
    {
        sc = new Scanner( System.in );
        ps = System.out;
        
        new curling_vanb().doit();
    }

}
