#include #include #include int main() { int n, m, as = 0, a; std::cin >> n >> m; std::vector ans(n); for(int i = 0; i < m; i++) { std::cin >> a; as += a; ans[as] = true; } as = n; std::cin >> m; for(int i = 0; i < m; i++) { std::cin >> a; as -= a; ans[as] = true; } int ansn = 0; for(int i = 0; i < n; i++) { if(!ans[i]) ansn++; } std::cout << ansn << std::endl; return 0; }