import java.util.*; public class judgeServer { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.nextLine(); int[] T = new int[N]; int[] s = new int[N]; for(int i = 0; i < N; i++){ T[i] = sc.nextInt(); } sc.nextLine(); for(int i = 0; i < N; i++){ s[i] = sc.nextInt(); } int count = 0; int wait = 0; for(int i = 0; i < N; i++){ if(wait <= s[i]){ count += 1; wait = s[i] + T[i]; } } System.out.println(count); sc.close(); } }