import itertools N = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) l = [x for x in range(N)] per = itertools.permutations(l) score = [] for case in per: res = 0 num = 0 for i in case: if(a[i] - b[num] > 0): res += a[i] - b[num] num += 1 score.append(res) score.sort(reverse = True) MAX = score[0] ans = 0 for sc in score: if(sc == MAX): ans += 1 else: break print(ans)