#include #include using namespace std; using namespace atcoder; using ll = long long; using ull = unsigned long long; using vi = vector; using vvi = vector; using vl = vector; using vvl = vector; using vs = vector; using vpi = vector>; using vpl = vector>; #define rep(i, s, n) for (int i = (s); i < (int)(n); ++i) #define repr(i, s, n) for (int i = (s); i >= (int)(n); --i) #define sz(x) ((int)(x).size()) template bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;} template bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;} auto _ = []{ios::sync_with_stdio(false); cin.tie(nullptr); return 0;}(); const int INFI = 1 << 30; const ll INFL = 1LL << 62; int main() { int n, x; cin >> n >> x; int sm=0; vi a (n); rep(i, 0, n){ cin >> a[i]; sm+=a[i]; } sm=max(0,(int)(sm-x)); cout << sm << '\n'; return 0; }