N = int(input()) t_list = list(map(int, input().split())) s_list = list(map(int, input().split())) t = 0 w = 0 for i in range(N): if w < s_list[i]: w = s_list[i] + t_list[i] - 1 t += 1 print(t)