#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int n, m1, m2, cnt = 0; cin >> n >> m1; vector a(n+1); for (int i = 0; i < m1; i++){ int temp; cin >> temp; cnt += temp; a[cnt]++; } cin >> m2; for (int i = 0; i < m2; i++){ int temp; cin >> temp; cnt -= temp; a[cnt]++; } for (int i = 0; i < n+1; i++){ if (!(a[i])) cnt++; } cout << cnt << endl; }