#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
template <class T>
inline void sort(T &a) {
  sort((a).begin(), (a).end());
}
template <class T>
inline void rsort(T &a) {
  sort((a).rbegin(), (a).rend());
}
template <class T>
inline void reverse(T &a) {
  reverse((a).begin(), (a).end());
}
template <class T, class U>
inline void checkmin(T &x, U y) {
  if (x > y) x = y;
}
template <class T, class U>
inline void checkmax(T &x, U y) {
  if (x < y) x = y;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(20);
  srand(time(NULL));
  long long a, b, c;
  cin >> a >> b >> c;
  long long ans = -1000000000000000007ll;
  checkmax(ans, c - (a + b - 1));
  checkmax(ans, a - (c + b - 1));
  checkmax(ans, b - (a + c - 1));
  checkmax(ans, 0);
  cout << ans;
  return 0;
}
