#!/bin/python3

import sys


house_left, house_right = map(int, input().strip().split(' '))
apple_tree, orange_tree = map(int, input().strip().split(' '))
_, _ = map(int, input().strip().split(' '))
apple_distances = map(int, input().strip().split(' '))
orange_distances = map(int, input().strip().split(' '))
print(len(list((filter(lambda apple_distance: house_left <= apple_tree + apple_distance <= house_right, apple_distances)))))
print(len(list(filter(lambda orange_distance: house_left <= orange_tree + orange_distance <= house_right, orange_distances))))

@@ -81,24 +81,76 @@
 split(' '))%0A
+house_location = range(house_left, house_right + 1)%0A
 apple_tree, 
@@ -400,30 +400,16 @@
 istance:
- house_left %3C=
  apple_t
@@ -429,30 +429,33 @@
 istance 
-%3C=
+in
  house_
-right
+location
 , apple_
@@ -518,22 +518,8 @@
 nce:
- house_left %3C=
  ora
@@ -549,22 +549,25 @@
 nce 
-%3C=
+in
  house_
-right
+location
 , or

Use house_location range