#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = acos(-1.0);
const double inf = 1e20;
const int INF = (~0u) >> 2;
inline bool eq(double x, double y) { return (x - y < -eps) ? 0 : x - y < eps; }
struct Point {
  double x, y;
  Point(){};
  Point(double x, double y) : x(x), y(y){};
  static double xmult(const Point &ps, const Point &pe, const Point &po) {
    return (ps.x - po.x) * (pe.y - po.y) - (pe.x - po.x) * (ps.y - po.y);
  }
  double operator*(const Point &b) const { return x * b.y - y * b.x; }
  double operator^(const Point &b) const { return x * b.x + y * b.y; }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  bool operator==(const Point &b) const {
    return fabs(b.x - x) < eps && fabs(b.y - y) < eps;
  }
  bool operator!=(const Point &b) const { return ((*this) == b) == false; }
  double dis2(const Point &b) const {
    return (x - b.x) * (x - b.x) + (y - b.y) * (y - b.y);
  }
  double dis(const Point &b) const {
    return sqrt((x - b.x) * (x - b.x) + (y - b.y) * (y - b.y));
  }
};
struct Vec2 {
  Point s, e;
  double a, b, c;
  Vec2() {}
  Vec2(const Point &s, const Point &e) : s(s), e(e) {}
  double operator*(const Point &vb) const {
    return (vb.y - s.y) * (e.x - s.x) - (vb.x - s.x) * (e.y - s.y);
  }
  double operator*(const Vec2 &vb) const {
    return (e.x - s.x) * (vb.e.y - vb.s.y) - (e.y - s.y) * (vb.e.x - vb.s.x);
  }
  bool pton() {
    a = s.y - e.y;
    b = e.x - s.x;
    c = s.x * e.y - s.y * e.x;
    return true;
  }
  friend bool operator<(const Point &vb, const Vec2 &vc) {
    return (vc.e.y - vc.s.y) * (vb.x - vc.s.x) <
           (vb.y - vc.s.y) * (vc.e.x - vc.s.x);
  }
  bool lhas(const Point &vb) const { return fabs((*this) * vb) < eps; }
  bool shas(const Point &vb) const {
    return lhas(vb) && vb.x - min(s.x, e.x) > -eps &&
           vb.x - max(s.x, e.x) < eps && vb.y - min(s.y, e.y) > -eps &&
           vb.y - max(s.y, e.y) < eps;
  }
  double dis(const Point &vb, bool isSegment = false) {
    pton();
    double td = (a * vb.x + b * vb.y + c) / sqrt(a * a + b * b);
    if (isSegment) {
      double xp = (b * b * vb.x - a * b * vb.y - a * c) / (a * a + b * b);
      double yp = (-a * b * vb.x + a * a * vb.y - b * c) / (a * a + b * b);
      double xb = max(s.x, e.x);
      double yb = max(s.y, e.y);
      double xs = s.x + e.x - xb;
      double ys = s.y + e.y - yb;
      if (xp > xb + eps || xp < xs - eps || yp > yb + eps || yp < ys - eps)
        td = min(vb.dis(s), vb.dis(e));
    }
    return fabs(td);
  }
  Point mirror(const Point &vb) const {
    Point ret;
    double d = a * a + b * b;
    ret.x = (b * b * vb.x - a * a * vb.x - 2 * a * b * vb.y - 2 * a * c) / d;
    ret.y = (a * a * vb.y - b * b * vb.y - 2 * a * b * vb.x - 2 * b * c) / d;
    return ret;
  }
  static Vec2 ppline(const Point &_a, const Point &_b) {
    Vec2 ret;
    ret.s.x = (_a.x + _b.x) / 2;
    ret.s.y = (_a.y + _b.y) / 2;
    ret.a = _b.x - _a.x;
    ret.b = _b.y - _a.y;
    ret.c = (_a.y - _b.y) * ret.s.y + (_a.x - _b.x) * ret.s.x;
    if (fabs(ret.a) > eps) {
      ret.e.y = 0.0;
      ret.e.x = -ret.c / ret.a;
      if (ret.e == ret.s) {
        ret.e.y = 1e10;
        ret.e.x = -(ret.c - ret.b * ret.e.y) / ret.a;
      }
    } else {
      ret.e.x = 0.0;
      ret.e.y = -ret.c / ret.b;
      if (ret.e == ret.s) {
        ret.e.x = 1e10;
        ret.e.y = -(ret.c - ret.a * ret.e.x) / ret.b;
      }
    }
    return ret;
  }
  bool equal(const Vec2 &vb) const { return lhas(vb.e) && lhas(vb.s); }
  bool parallel(const Vec2 &vb) const { return fabs((*this) * vb) < eps; }
  Point crossLPt(Vec2 vb) {
    Point ret = s;
    double t =
        ((s.x - vb.s.x) * (vb.s.y - vb.e.y) -
         (s.y - vb.s.y) * (vb.s.x - vb.e.x)) /
        ((s.x - e.x) * (vb.s.y - vb.e.y) - (s.y - e.y) * (vb.s.x - vb.e.x));
    ret.x += (e.x - s.x) * t;
    ret.y += (e.y - s.y) * t;
    return ret;
  }
  bool crossSL(const Vec2 &vb) const {
    double rs = (*this) * vb.s;
    double re = (*this) * vb.e;
    return rs * re < eps;
  }
  bool isCrossSS(const Vec2 &vb) const {
    return ((max(s.x, e.x) >= min(vb.s.x, vb.e.x)) &&
            (max(vb.s.x, vb.e.x) >= min(s.x, e.x)) &&
            (max(s.y, e.y) >= min(vb.s.y, vb.e.y)) &&
            (max(vb.s.y, vb.e.y) >= min(s.y, e.y)) &&
            ((Vec2(vb.s, s) * vb) * (vb * Vec2(vb.s, e)) >= 0.0) &&
            ((Vec2(s, vb.s) * (*this)) * ((*this) * Vec2(s, vb.e)) >= 0.0));
  }
};
struct Circle {
  Point c;
  double r;
  double db, de;
  Circle operator-(Circle &cb) const {
    double d2 = c.dis2(cb.c);
    double d = c.dis(cb.c);
    double ans = acos((d2 + r * r - cb.r * cb.r) / (2 * d * r));
    Point py = cb.c - c;
    double oans = atan2(py.y, py.x);
    Circle res;
    res.c = c;
    res.r = r;
    res.db = oans + ans;
    res.de = oans - ans + 2 * pi;
    return res;
  }
  Circle operator+(Circle &cb) const {
    double d2 = c.dis2(cb.c);
    double d = c.dis(cb.c);
    double ans = acos((d2 + r * r - cb.r * cb.r) / (2 * d * r));
    Point py = cb.c - c;
    double oans = atan2(py.y, py.x);
    Circle res;
    res.c = c;
    res.r = r;
    res.db = oans - ans;
    res.de = oans + ans;
    return res;
  }
  pair<Vec2, Vec2> tangent(const Point &cb) const {
    double d = c.dis(cb);
    double angp = acos(r / d), ango = atan2(cb.y - c.y, cb.x - c.x);
    Point pl = Point(c.x + r * cos(ango + angp), c.y + r * sin(ango + angp)),
          pr = Point(c.x + r * cos(ango - angp), c.y + r * sin(ango - angp));
    return make_pair(Vec2(cb, pl), Vec2(cb, pr));
  }
  pair<Point, Point> cross(Vec2 cb) const {
    cb.pton();
    double td =
        fabs(cb.a * c.x + cb.b * c.y + cb.c) / sqrt(cb.a * cb.a + cb.b * cb.b);
    double xp = (cb.b * cb.b * c.x - cb.a * cb.b * c.y - cb.a * cb.c) /
                (cb.a * cb.a + cb.b * cb.b);
    double yp = (-cb.a * cb.b * c.x + cb.a * cb.a * c.y - cb.b * cb.c) /
                (cb.a * cb.a + cb.b * cb.b);
    double ango = atan2(yp - c.y, xp - c.x);
    double angp = acos(td / r);
    return make_pair(
        Point(c.x + r * cos(ango + angp), c.y + r * sin(ango + angp)),
        Point(c.x + r * cos(ango - angp), c.y + r * sin(ango - angp)));
  }
  int relation(const Circle &b) const {
    double len = c.dis(b.c);
    if (eq(r + b.r, len)) return 3;
    if (r + b.r < len) return 1;
    double r1 = max(r, b.r), r2 = min(r, b.r);
    if (eq(r1, r2 + len)) return 4;
    if (r1 > r2 + len) return 5;
    return 2;
  }
};
struct Triangle {
  Point a, b, c;
  Triangle() {}
  Triangle(Point a, Point b, Point c) : a(a), b(b), c(c) {}
  double area() { return fabs(Point::xmult(a, b, c)) / 2.0; }
  Point circumcenter() {
    Vec2 u, v;
    u.s.x = (a.x + b.x) / 2;
    u.s.y = (a.y + b.y) / 2;
    u.e.x = u.s.x - a.y + b.y;
    u.e.y = u.s.y + a.x - b.x;
    v.s.x = (a.x + c.x) / 2;
    v.s.y = (a.y + c.y) / 2;
    v.e.x = v.s.x - a.y + c.y;
    v.e.y = v.s.y + a.x - c.x;
    return u.crossLPt(v);
  }
  Point incenter() {
    Vec2 u, v;
    double m, n;
    u.s = a;
    m = atan2(b.y - a.y, b.x - a.x);
    n = atan2(c.y - a.y, c.x - a.x);
    u.e.x = u.s.x + cos((m + n) / 2);
    u.e.y = u.s.y + sin((m + n) / 2);
    v.s = b;
    m = atan2(a.y - b.y, a.x - b.x);
    n = atan2(c.y - b.y, c.x - b.x);
    v.e.x = v.s.x + cos((m + n) / 2);
    v.e.y = v.s.y + sin((m + n) / 2);
    return u.crossLPt(v);
  }
  Point perpencenter() {
    Vec2 u, v;
    u.s = c;
    u.e.x = u.s.x - a.y + b.y;
    u.e.y = u.s.y + a.x - b.x;
    v.s = b;
    v.e.x = v.s.x - a.y + c.y;
    v.e.y = v.s.y + a.x - c.x;
    return u.crossLPt(v);
  }
  Point barycenter() {
    Vec2 u, v;
    u.s.x = (a.x + b.x) / 2;
    u.s.y = (a.y + b.y) / 2;
    u.e = c;
    v.s.x = (a.x + c.x) / 2;
    v.s.y = (a.y + c.y) / 2;
    v.e = b;
    return u.crossLPt(v);
  }
  Point fermentPoint() {
    Point u, v;
    double step =
        fabs(a.x) + fabs(a.y) + fabs(b.x) + fabs(b.y) + fabs(c.x) + fabs(c.y);
    int i, j, k;
    u.x = (a.x + b.x + c.x) / 3;
    u.y = (a.y + b.y + c.y) / 3;
    while (step > eps)
      for (k = 0; k < 10; step /= 2, k++)
        for (i = -1; i <= 1; i++)
          for (j = -1; j <= 1; j++) {
            v.x = u.x + step * i;
            v.y = u.y + step * j;
            if (u.dis(a) + u.dis(b) + u.dis(c) > v.dis(a) + v.dis(b) + v.dis(c))
              u = v;
          }
    return u;
  }
};
int main() {
  Circle a, b;
  scanf("%lf%lf%lf%lf%lf%lf", &a.c.x, &a.c.y, &a.r, &b.c.x, &b.c.y, &b.r);
  int t = a.relation(b);
  double ans = 0;
  if (t == 1) ans = (a.c.dis(b.c) - a.r - b.r) / 2.0;
  if (t == 2) ans = 0;
  if (t == 3) ans = 0;
  if (t == 4) ans = 0;
  if (t == 5) {
    double len = a.c.dis(b.c);
    double r1 = max(a.r, b.r), r2 = min(a.r, b.r);
    ans = (r1 - len - r2) / 2.0;
  }
  printf("%lf\n", ans);
  return 0;
}
