#b136. 資料分組 (**)n = int(input())nums = [int(x) for x in input().split()]M = int(input())x = 0s = 0for num in nums: if num > M: x += 1 elif num < M: s += 1print(f"{x} {s}")