#include [[nodiscard]] static inline constexpr int_fast32_t solve(const int_fast32_t N, const std::vector& A, const int_fast32_t v) noexcept { return std::accumulate(A.begin(), A.end(), INT32_C(0)) - v; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int_fast32_t N, v; std::cin >> N; std::vector A(N); for (auto& a : A) std::cin >> a; std::cin >> v; std::cout << solve(N, A, v) << '\n'; return 0; }