#include <bits/stdc++.h>
using namespace std;
struct RTC {};
int main() {
  double x1, y1, x2, y2, r1, r2;
  cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
  double d2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  if (d2 < (r1 + r2) * (r1 + r2)) {
    double rmax = max(r1, r2);
    double rmin = min(r1, r2);
    if ((rmax - rmin) * (rmax - rmin) > d2) {
      printf("%.10f\n", (rmax - sqrt(d2) - rmin) / 2.0);
    } else {
      cout << "0\n";
    }
  } else {
    printf("%.10f", (sqrt(d2) - r1 - r2) / 2.0);
  }
  return 0;
}
