#!/bin/python3.8

import math
import os
import random
import re
import sys

# Complete the countApplesAndOranges function below.
def countApplesAndOranges(s, t, a, b, apples, oranges):
    count_apple, count_orange = 0, 0
    for apple in apples:
        dist_apple = apple+a
        if dist_apple >=s and dist_apple<=t:
            count_apple +=1
    for orange in oranges:
        dist_orange = orange+b
        if dist_orange >=s and dist_orange<=t:
            count_orange +=1
    print(count_apple)
    print(count_orange)

if __name__ == '__main__':
    st = input().split()

    s = int(st[0])

    t = int(st[1])

    ab = input().split()

    a = int(ab[0])

    b = int(ab[1])

    mn = input().split()

    m = int(mn[0])

    n = int(mn[1])

    apples = list(map(int, input().rstrip().split()))

    oranges = list(map(int, input().rstrip().split()))

    countApplesAndOranges(s, t, a, b, apples, oranges)
