class Hit
  def initialize
    @result = []
    while line = $stdin.gets do
      @hit = 0
      @blow = 0
      @a = line.chomp.split(' ').map(&:to_i) 
      @b = $stdin.gets.chomp.split(' ').map(&:to_i) 
      check_hit
      check_blow
      @result.push([@hit, @blow])
    end

    @result.each do |ans|
      puts "#{ans[0]} #{ans[1]}"
    end
  end

  def check_hit
    @a.each_with_index do |a, index|
      if @a[index] == @b[index]
        @hit += 1
        @b[index] = 0
      end
    end
  end

  def check_blow
    @a.each_with_index do |a, index|
      @blow += [@a.count(a), @b.count(a)].min
      @b = @b.map do |n|
        if n == a
          0
        else
          n
        end
      end
    end
  end
end

h = Hit.new