#include //#include using namespace std; using ll = long long; using graph = vector>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) vector dh = {-1,0,1,0,-1,1,1,-1}; vector dw = {0,1,0,-1,1,1,-1,-1}; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, x; cin >> n >> x; int ans = -x; rep(i, n) { int a; cin >> a; ans += a; } ans = max(0, ans); cout << ans << "\n"; return 0; }