#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
//============================================================================================

struct segment {
	double a = 0, b = 0, c = 0;
} firstSegment, secondSegment;

struct pairCoor {
	pdd a, b;
};

int cou;
pdd sp;
pairCoor p[3];
pii po;
int tc;

inline double calDistance(const pdd &a, const pdd &b) {
	return sqrt(p(b.first - a.first) + p(b.second - a.second));
}

// giải phương trình đường thẳng
inline pdd solveTQE2H(const pairCoor &pc, segment mySegmet) {
	double a = pc.b.second - pc.a.second;
	double b = pc.b.first - pc.a.first;

	if (!a) {
		mySegmet.a = 0, mySegmet.b = 1, mySegmet.c = pc.a.second;
		return make_pair(0, -1);
	}

	if (!b) {
		mySegmet.a = 1, mySegmet.b = 0, mySegmet.c = -pc.a.first;
		return make_pair(1, 0);
	}

	mySegmet.a = a, mySegmet.b = -b, mySegmet.c = ((-pc.a.first*(pc.b.second - pc.a.second)) - (-pc.a.second*(pc.b.first - pc.a.first)));
	return make_pair(a, -b);
}

// tìm 2 cạnh có cùng 1 điểm chung
inline pii findSamePoint() {
	pii res = { -1, -1 };

	forn(i, 3, 0) {
		forn(j, 3, i + 1) {
			if (p[i].a == p[j].a || p[i].a == p[j].b) {
				sp = p[i].a;
				res = { i, j};
				++cou;
			}

			if (p[i].b == p[j].a || p[i].b == p[j].b) {
				sp = p[i].b;
				res = { i, j };
				++cou;
			}
		}
	}

	return cou == 1 ? res : make_pair(-1, -1);
}

inline bool isAc() {
	int thirdSegment = 3 - po.first - po.second;

	if ((firstSegment.a*p[thirdSegment].a.first + firstSegment.b*p[thirdSegment].a.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].b.first + secondSegment.b*p[thirdSegment].b.second + secondSegment.c <= 0.0000001)) {
		double first = calDistance(sp, p[thirdSegment].a);
		double second = calDistance(sp, p[thirdSegment].b);
		double third = calDistance(p[thirdSegment].a, p[thirdSegment].b);

		return third/first >= 0.25 && third/second >= 0.25;
	}

	if ((firstSegment.a*p[thirdSegment].b.first + firstSegment.b*p[thirdSegment].b.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].a.first + secondSegment.b*p[thirdSegment].a.second + secondSegment.c <= 0.0000001)) {
		double first = calDistance(sp, p[thirdSegment].b);
		double second = calDistance(sp, p[thirdSegment].a);
		double third = calDistance(p[thirdSegment].a, p[thirdSegment].b);

		return third / first >= 0.25 && third / second >= 0.25;
	}

	return false;
}

// tính số đo góc kẹp giữa
inline double calAngleBetween() {
	pdd A = solveTQE2H(p[po.first], firstSegment);
	pdd B = solveTQE2H(p[po.second], secondSegment);

	double dot = fabs(A.first*B.first + A.second*B.second);
	double d1 = sqrt(p(A.first) + p(A.second));
	double d2 = sqrt(p(B.first) + p(B.second));

	return acos(dot / (d1*d2))*(180.0/pi);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	cin >> tc;

	while (tc--) {
		cou = 0;

		forn(i, 3, 0) {
			cin >> p[i].a.first >> p[i].a.second >> p[i].b.first >> p[i].b.second;
		}

		po = findSamePoint();

		if (3 - po.first - po.second <= 2) {
			double angleBetween = calAngleBetween();

			if (angleBetween <= 90 && angleBetween > 0) {
				if (isAc()) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
//============================================================================================

struct segment {
	double a = 0, b = 0, c = 0;
} firstSegment, secondSegment;

struct pairCoor {
	pdd a, b;
};

int cou;
pdd sp;
pairCoor p[3];
pii po;
int tc;

inline double calDistance(const pdd &a, const pdd &b) {
	return sqrt(p(b.first - a.first) + p(b.second - a.second));
}

// giải phương trình đường thẳng
inline pdd solveTQE2H(const pairCoor &pc, segment &mySegmet) {
	double a = pc.b.second - pc.a.second;
	double b = pc.b.first - pc.a.first;

	if (!a) {
		mySegmet.a = 0, mySegmet.b = 1, mySegmet.c = pc.a.second;
		return make_pair(0, -1);
	}

	if (!b) {
		mySegmet.a = 1, mySegmet.b = 0, mySegmet.c = -pc.a.first;
		return make_pair(1, 0);
	}

	mySegmet.a = a, mySegmet.b = -b, mySegmet.c = ((-pc.a.first*(pc.b.second - pc.a.second)) - (-pc.a.second*(pc.b.first - pc.a.first)));
	return make_pair(a, -b);
}

// tìm 2 cạnh có cùng 1 điểm chung
inline pii findSamePoint() {
	pii res = { -1, -1 };

	forn(i, 3, 0) {
		forn(j, 3, i + 1) {
			if (p[i].a == p[j].a || p[i].a == p[j].b) {
				sp = p[i].a;
				res = { i, j};
				++cou;
			}

			if (p[i].b == p[j].a || p[i].b == p[j].b) {
				sp = p[i].b;
				res = { i, j };
				++cou;
			}
		}
	}

	return cou == 1 ? res : make_pair(-1, -1);
}

inline bool isAc() {
	int thirdSegment = 3 - po.first - po.second;

	if ((firstSegment.a*p[thirdSegment].a.first + firstSegment.b*p[thirdSegment].a.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].b.first + secondSegment.b*p[thirdSegment].b.second + secondSegment.c <= 0.0000001)) {
		double first = calDistance(sp, p[thirdSegment].a);
		double second = calDistance(sp, p[thirdSegment].b);
		double third = calDistance(p[thirdSegment].a, p[thirdSegment].b);

		return third/first >= 0.25 && third/second >= 0.25;
	}

	if ((firstSegment.a*p[thirdSegment].b.first + firstSegment.b*p[thirdSegment].b.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].a.first + secondSegment.b*p[thirdSegment].a.second + secondSegment.c <= 0.0000001)) {
		double first = calDistance(sp, p[thirdSegment].b);
		double second = calDistance(sp, p[thirdSegment].a);
		double third = calDistance(p[thirdSegment].a, p[thirdSegment].b);

		return third / first >= 0.25 && third / second >= 0.25;
	}

	return false;
}

// tính số đo góc kẹp giữa
inline double calAngleBetween() {
	pdd A = solveTQE2H(p[po.first], firstSegment);
	pdd B = solveTQE2H(p[po.second], secondSegment);

	double dot = fabs(A.first*B.first + A.second*B.second);
	double d1 = sqrt(p(A.first) + p(A.second));
	double d2 = sqrt(p(B.first) + p(B.second));

	return acos(dot / (d1*d2))*(180.0/pi);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	cin >> tc;

	while (tc--) {
		cou = 0;

		forn(i, 3, 0) {
			cin >> p[i].a.first >> p[i].a.second >> p[i].b.first >> p[i].b.second;
		}

		po = findSamePoint();

		if (3 - po.first - po.second <= 2) {
			double angleBetween = calAngleBetween();

			if (angleBetween <= 90 && angleBetween > 0) {
				if (isAc()) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
//============================================================================================

struct segment {
	double a = 0, b = 0, c = 0;
} firstSegment, secondSegment;

struct pairCoor {
	pdd a, b;
};

pdd sp;
pairCoor p[3];
pii po;
int tc;

inline double calDistance(const pdd &a, const pdd &b) {
	return sqrt(p(b.first - a.first) + p(b.second - a.second));
}

// giải phương trình đường thẳng
inline pdd solveTQE2H(const pairCoor &pc, segment mySegmet) {
	double a = pc.b.second - pc.a.second;
	double b = pc.b.first - pc.a.first;

	if (!a) {
		mySegmet.a = 0, mySegmet.b = 1, mySegmet.c = -pc.a.second;
		return make_pair(0, 1);
	}

	if (!b) {
		mySegmet.a = 1, mySegmet.b = 0, mySegmet.c = -pc.a.first;
		return make_pair(1, 0);
	}

	mySegmet.a = a, mySegmet.b = -b, mySegmet.c = ((-pc.a.first*(pc.b.second - pc.a.second)) - (-pc.a.second*(pc.b.first - pc.a.first)));
	return make_pair(a, -b);
}

// tìm 2 cạnh có cùng 1 điểm chung
inline pii findSamePoint() {
	forn(i, 3, 0) {
		forn(j, 3, i + 1) {
			if (p[i].a == p[j].a || p[i].a == p[j].b) {
				sp = p[i].a;
				return make_pair(i, j);
			}

			if (p[i].b == p[j].a || p[i].b == p[j].b) {
				sp = p[i].b;
				return make_pair(i, j);
			}
		}
	}

	return make_pair(-1, -1);
}

inline bool isAc() {
	int thirdSegment = 3 - po.first - po.second;

	if ((firstSegment.a*p[thirdSegment].a.first + firstSegment.b*p[thirdSegment].a.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].b.first + secondSegment.b*p[thirdSegment].b.second + secondSegment.c <= 0.0000001)) {
		double first = calDistance(sp, p[thirdSegment].a);
		double second = calDistance(sp, p[thirdSegment].b);
		double third = calDistance(p[thirdSegment].a, p[thirdSegment].b);

		return third/first >= 0.25 && third/second >= 0.25;
	}

	if ((firstSegment.a*p[thirdSegment].b.first + firstSegment.b*p[thirdSegment].b.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].a.first + secondSegment.b*p[thirdSegment].a.second + secondSegment.c <= 0.0000001)) {
		double first = calDistance(sp, p[thirdSegment].b);
		double second = calDistance(sp, p[thirdSegment].a);
		double third = calDistance(p[thirdSegment].a, p[thirdSegment].b);

		return third / first >= 0.25 && third / second >= 0.25;
	}

	return false;
}

// tính số đo góc kẹp giữa
inline double calAngleBetween() {
	pdd A = solveTQE2H(p[po.first], firstSegment);
	pdd B = solveTQE2H(p[po.second], secondSegment);

	double dot = fabs(A.first*B.first + A.second*B.second);
	double d1 = sqrt(p(A.first) + p(A.second));
	double d2 = sqrt(p(B.first) + p(B.second));

	return acos(dot / (d1*d2))*(180.0/pi);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	cin >> tc;

	while (tc--) {
		forn(i, 3, 0) {
			cin >> p[i].a.first >> p[i].a.second >> p[i].b.first >> p[i].b.second;
		}

		po = findSamePoint();

		if (3 - po.first - po.second <= 2) {
			double angleBetween = calAngleBetween();

			if (angleBetween <= 90 && angleBetween > 0) {
				if (isAc()) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//=============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
typedef pair<ld, ld> p2ld;
typedef pair<char, char> pcc;
//=============================================================================================

struct coor {
	ll x, y;

	friend istream &operator >> (istream &is, coor &A) {
		is >> A.x >> A.y;
		return is;
	}

	friend inline bool operator== (const coor &A, const coor &B) {
		return A.x == B.x && A.y == B.y;
	}

	friend inline double calDistance(const coor &a, const coor &b) {
		return sqrt((double)p(b.x - a.x) + (double)p(b.y - a.y));
	}

	friend inline pair<ll, ll> calVector(const coor &A, const coor &B) {
		return{ B.x - A.x, B.y - A.y };
	}
};

pair<coor, coor> p[3];

inline pii findSamePoints() {
	forn(i, 2, 0) {
		forn(j, 3, i + 1) {
			if (p[i].first == p[j].first || p[i].first == p[j].second || p[i].second == p[j].first || p[i].second == p[j].second) {
				return{ i, j };
			}
		}
	}

	return{ -1, -1 };
}

inline bool calAngleBetween(const pii &sp) {
	p2ll AB = calVector(p[sp.first].first, p[sp.first].second);
	p2ll CD = calVector(p[sp.second].first, p[sp.second].second);
	double head = (AB.first*CD.first + AB.second*CD.second);
	double bot = sqrt(AB.first*AB.first*1.0 + AB.second*AB.second*1.0) * sqrt(CD.first*CD.first*1.0 + CD.second*CD.second*1.0);
	double deg = acos(fabs(head / bot))*(180.0 / pi);

	return deg > 0 && deg <= 90;
}

inline bool isIntoSegment(int in, const coor &A) {
	double d = calDistance(p[in].first, p[in].second);
	double d1 = calDistance(p[in].first, A);
	double d2 = calDistance(p[in].second, A);

	return (d == d1 + d2 && 0.25 <= d1 / d2 && d1 / d2 <= 4);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	int tc;

	cin >> tc;

	while (tc--) {
		cin >> p[0].first >> p[0].second;
		cin >> p[1].first >> p[1].second;
		cin >> p[2].first >> p[2].second;

		if (p[0].first == p[0].second || p[1].first == p[1].second || p[2].first == p[2].second) {
			cout << "NO" << endl;
			continue;
		}

		pii sp = findSamePoints();

		if (sp.first != -1 && sp.second != -1) {
			if (calAngleBetween(sp)) {
				int it = 3 - sp.first - sp.second;

				if (p[sp.first].first == p[sp.second].second) {
					swap(p[sp.second].first, p[sp.second].second);
				}
				else if (p[sp.first].second == p[sp.second].first) {
					swap(p[sp.first].first, p[sp.first].second);
				}

				if (isIntoSegment(sp.first, p[it].first) && isIntoSegment(sp.second, p[it].second)) {
					cout << "YES" << endl;
					continue;
				}
				else if (isIntoSegment(sp.first, p[it].second) && isIntoSegment(sp.second, p[it].first)) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//=============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
typedef pair<ld, ld> p2ld;
typedef pair<char, char> pcc;
//=============================================================================================

struct coor {
	ll x, y;

	friend istream &operator >> (istream &is, coor &A) {
		is >> A.x >> A.y;
		return is;
	}

	friend inline bool operator== (const coor &A, const coor &B) {
		return A.x == B.x && A.y == B.y;
	}

	friend inline ld calDistance(const coor &a, const coor &b) {
		return sqrt((ld)p(b.x - a.x) + (ld)p(b.y - a.y));
	}
};

pair<coor, coor> p[3];

inline pii findSamePoints() {
	forn(i, 2, 0) {
		forn(j, 3, i + 1) {
			if (p[i].first == p[j].first || p[i].first == p[j].second || p[i].second == p[j].first || p[i].second == p[j].second) {
				return{ i, j };
			}
		}
	}

	return{ -1, -1 };
}

inline bool calAngleBetween(const pii &sp) {
	ld AB = calDistance(p[sp.first].first, p[sp.first].second);
	ld AC = calDistance(p[sp.second].first, p[sp.second].second);
	ld BC = calDistance(p[sp.first].second, p[sp.second].second);

	if (AB && AC && BC && AB + AC > BC) {
		double deg = acos((p(AB) + p(AC) - p(BC)) / (2 * AB*AC))*(180.0 / pi);

		return 0 < deg && deg <= 90;
	}

	return false;
}

inline bool isIntoSegment(int in, const coor &A) {
	ld d = calDistance(p[in].first, p[in].second);
	ld d1 = calDistance(p[in].first, A);
	ld d2 = calDistance(A, p[in].second);

	return (d && d1 && d2 && d + 0.00001 >= d1 + d2 && 0.25 <= d1 / d2 && d1 / d2 <= 4);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	int tc;

	cin >> tc;

	while (tc--) {
		cin >> p[0].first >> p[0].second;
		cin >> p[1].first >> p[1].second;
		cin >> p[2].first >> p[2].second;

		if (p[0].first == p[0].second || p[1].first == p[1].second || p[2].first == p[2].second) {
			cout << "NO" << endl;
			continue;
		}

		pii sp = findSamePoints();

		if (sp.first != -1 && sp.second != -1) {
			if (p[sp.first].first == p[sp.second].second) {
				swap(p[sp.second].first, p[sp.second].second);
			}
			else if (p[sp.first].second == p[sp.second].first) {
				swap(p[sp.first].first, p[sp.first].second);
			}
			else if (p[sp.first].second == p[sp.second].second) {
				swap(p[sp.first].first, p[sp.first].second);
				swap(p[sp.second].first, p[sp.second].second);
			}

			if (p[sp.first].second == p[sp.second].second) {
				cout << "NO" << endl;
				continue;
			}

			if (calAngleBetween(sp)) {
				int it = 3 - sp.first - sp.second;

				if (isIntoSegment(sp.first, p[it].first) && isIntoSegment(sp.second, p[it].second)) {
					cout << "YES" << endl;
					continue;
				}
				else if (isIntoSegment(sp.first, p[it].second) && isIntoSegment(sp.second, p[it].first)) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//=============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
typedef pair<ld, ld> p2ld;
typedef pair<char, char> pcc;
//=============================================================================================

struct coor {
	ll x, y;

	friend istream &operator >> (istream &is, coor &A) {
		is >> A.x >> A.y;
		return is;
	}

	friend inline bool operator== (const coor &A, const coor &B) {
		return A.x == B.x && A.y == B.y;
	}

	friend inline double calDistance(const coor &a, const coor &b) {
		return sqrt((double)p(b.x - a.x) + (double)p(b.y - a.y));
	}
};

pair<coor, coor> p[3];

inline pii findSamePoints() {
	forn(i, 2, 0) {
		forn(j, 3, i + 1) {
			if (p[i].first == p[j].first || p[i].first == p[j].second || p[i].second == p[j].first || p[i].second == p[j].second) {
				return{ i, j };
			}
		}
	}

	return{ -1, -1 };
}

inline bool calAngleBetween(const pii &sp) {
	ld AB = calDistance(p[sp.first].first, p[sp.first].second);
	ld AC = calDistance(p[sp.second].first, p[sp.second].second);
	ld BC = calDistance(p[sp.first].second, p[sp.second].second);

	if (AB && AC && BC && AB + AC > BC && AB + BC > AC && BC + AC > AB) {
		double deg = acos((p(AB) + p(AC) - p(BC)) / (2 * AB*AC))*(180.0 / pi);

		return 0 < deg && deg <= 90;
	}

	return false;
}

inline bool isIntoSegment(int in, const coor &A) {
	double d = calDistance(p[in].first, p[in].second);
	double d1 = calDistance(p[in].first, A);
	double d2 = calDistance(A, p[in].second);

	return (d && d1 && d2 && ((d1 + d2) - d) >= 0  && 0.25 <= d1 / d2 && d1 / d2 <= 4);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	int tc;

	cin >> tc;

	while (tc--) {
		cin >> p[0].first >> p[0].second;
		cin >> p[1].first >> p[1].second;
		cin >> p[2].first >> p[2].second;

		if (p[0].first == p[0].second || p[1].first == p[1].second || p[2].first == p[2].second) {
			cout << "NO" << endl;
			continue;
		}

		pii sp = findSamePoints();

		if (sp.first != -1 && sp.second != -1) {
			if (p[sp.first].first == p[sp.second].second) {
				swap(p[sp.second].first, p[sp.second].second);
			}
			else if (p[sp.first].second == p[sp.second].first) {
				swap(p[sp.first].first, p[sp.first].second);
			}
			else if (p[sp.first].second == p[sp.second].second) {
				swap(p[sp.first].first, p[sp.first].second);
				swap(p[sp.second].first, p[sp.second].second);
			}

			if (calAngleBetween(sp)) {
				int it = 3 - sp.first - sp.second;

				if (isIntoSegment(sp.first, p[it].first) && isIntoSegment(sp.second, p[it].second)) {
					cout << "YES" << endl;
					continue;
				}
				else if (isIntoSegment(sp.first, p[it].second) && isIntoSegment(sp.second, p[it].first)) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
typedef pair<ld, ld> p2ld;
//============================================================================================

struct segment {
	ld a = 0, b = 0, c = 0;
} firstSegment, secondSegment;

struct pairCoor {
	p2ld a, b;
};

int cou;
pairCoor p[3];
pii po;
int tc;

inline double calDistance(const p2ld &a, const p2ld &b) {
	return sqrt(p(b.first - a.first) + p(b.second - a.second));
}

// giải phương trình đường thẳng
inline pdd solveTQE2H(const pairCoor &pc, segment &mySegmet) {
	double a = pc.b.second - pc.a.second;
	double b = pc.b.first - pc.a.first;

	if (!a) {
		mySegmet.a = 0, mySegmet.b = 1, mySegmet.c = -pc.a.second;
		return make_pair(0, 1);
	}

	if (!b) {
		mySegmet.a = 1, mySegmet.b = 0, mySegmet.c = -pc.a.first;
		return make_pair(1, 0);
	}

	mySegmet.a = a, mySegmet.b = -b, mySegmet.c = ((-pc.a.first*a) - (-pc.a.second*b));
	return make_pair(a, -b);
}

// tìm 2 cạnh có cùng 1 điểm chung
inline pii findSamePoint() {
	pii res = { -1, -1 };

	forn(i, 3, 0) {
		forn(j, 3, i + 1) {
			if (p[i].a == p[j].a || p[i].a == p[j].b) {
				res = { i, j };
				++cou;
			}

			if (p[i].b == p[j].a || p[i].b == p[j].b) {
				res = { i, j };
				++cou;
			}
		}
	}

	return cou == 1 ? res : make_pair(-1, -1);
}

inline bool isAc() {
	int thirdSegment = 3 - po.first - po.second;

	if ((firstSegment.a*p[thirdSegment].a.first + firstSegment.b*p[thirdSegment].a.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].b.first + secondSegment.b*p[thirdSegment].b.second + secondSegment.c <= 0.0000001)) {
		ld f1 = calDistance(p[po.first].a, p[thirdSegment].a);
		ld f2 = calDistance(p[po.first].b, p[thirdSegment].a);
		ld f = calDistance(p[po.first].a, p[po.first].b);
		ld s1 = calDistance(p[po.second].a, p[thirdSegment].b);
		ld s2 = calDistance(p[po.second].b, p[thirdSegment].b);
		ld s = calDistance(p[po.second].a, p[po.second].b);

		if (f1 + f2 == f && s1 + s2 == s) {
			if (f1 / f2 >= 0.25 && f1 / f2 <= 4 && s1 / s2 >= 0.25 && s1 / s2 <= 4) {
				return true;
			}
		}
	}

	if ((firstSegment.a*p[thirdSegment].b.first + firstSegment.b*p[thirdSegment].b.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].a.first + secondSegment.b*p[thirdSegment].a.second + secondSegment.c <= 0.0000001)) {
		ld f1 = calDistance(p[po.first].a, p[thirdSegment].b);
		ld f2 = calDistance(p[po.first].b, p[thirdSegment].b);
		ld f = calDistance(p[po.first].a, p[po.first].b);
		ld s1 = calDistance(p[po.second].a, p[thirdSegment].a);
		ld s2 = calDistance(p[po.second].b, p[thirdSegment].a);
		ld s = calDistance(p[po.second].a, p[po.second].b);

		if (f1 + f2 == f && s1 + s2 == s) {
			if (f1 / f2 >= 0.25 && f1 / f2 <= 4 && s1 / s2 >= 0.25 && s1 / s2 <= 4) {
				return true;
			}
		}
	}

	return false;
}

// tính số đo góc kẹp giữa
inline double calAngleBetween() {
	p2ld A = solveTQE2H(p[po.first], firstSegment);
	p2ld B = solveTQE2H(p[po.second], secondSegment);

	ld dot = fabs(A.first*B.first + A.second*B.second);
	ld d1 = sqrt(p(A.first) + p(A.second));
	ld d2 = sqrt(p(B.first) + p(B.second));

	return acos(dot / (d1*d2))*(180.0 / pi);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	cin >> tc;

	while (tc--) {
		cou = 0;

		forn(i, 3, 0) {
			cin >> p[i].a.first >> p[i].a.second >> p[i].b.first >> p[i].b.second;
		}

		po = findSamePoint();

		if (3 - po.first - po.second <= 2) {
			double angleBetween = calAngleBetween();

			if (angleBetween <= 90 && angleBetween > 0) {
				if (isAc()) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
typedef pair<ld, ld> p2ld;
//============================================================================================

struct segment {
	ld a = 0, b = 0, c = 0;
} firstSegment, secondSegment;

struct pairCoor {
	p2ld a, b;
};

int cou;
pairCoor p[3];
pii po;
int tc;

inline double calDistance(const p2ld &a, const p2ld &b) {
	return sqrt(p(b.first - a.first) + p(b.second - a.second));
}

// giải phương trình đường thẳng
inline pdd solveTQE2H(const pairCoor &pc, segment &mySegmet) {
	double a = pc.b.second - pc.a.second;
	double b = pc.b.first - pc.a.first;

	if (!a && !b) {
		mySegmet.a = 0, mySegmet.b = 0, mySegmet.c = 69;
		return make_pair(0, 0);
	}

	if (!a) {
		mySegmet.a = 0, mySegmet.b = 1, mySegmet.c = -pc.a.second;
		return make_pair(0, 1);
	}

	if (!b) {
		mySegmet.a = 1, mySegmet.b = 0, mySegmet.c = -pc.a.first;
		return make_pair(1, 0);
	}

	mySegmet.a = a, mySegmet.b = -b, mySegmet.c = ((-pc.a.first*a) - (-pc.a.second*b));
	return make_pair(a, -b);
}

// tìm 2 cạnh có cùng 1 điểm chung
inline pii findSamePoint() {
	pii res = { -1, -1 };

	forn(i, 3, 0) {
		forn(j, 3, i + 1) {
			if (p[i].a == p[j].a || p[i].a == p[j].b) {
				res = { i, j };
				++cou;
			}

			if (p[i].b == p[j].a || p[i].b == p[j].b) {
				res = { i, j };
				++cou;
			}
		}
	}

	return cou == 1 ? res : make_pair(-1, -1);
}

inline bool isAc() {
	int thirdSegment = 3 - po.first - po.second;

	if ((firstSegment.a*p[thirdSegment].a.first + firstSegment.b*p[thirdSegment].a.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].b.first + secondSegment.b*p[thirdSegment].b.second + secondSegment.c <= 0.0000001)) {
		ld f1 = calDistance(p[po.first].a, p[thirdSegment].a);
		ld f2 = calDistance(p[po.first].b, p[thirdSegment].a);
		ld f = calDistance(p[po.first].a, p[po.first].b);
		ld s1 = calDistance(p[po.second].a, p[thirdSegment].b);
		ld s2 = calDistance(p[po.second].b, p[thirdSegment].b);
		ld s = calDistance(p[po.second].a, p[po.second].b);

		if (f1 + f2 <= f + 0.0000001 && s1 + s2 <= s + 0.0000001) {
			if (f1 / f2 >= 0.25 && f1 / f2 <= 4 && s1 / s2 >= 0.25 && s1 / s2 <= 4) {
				return true;
			}
		}
	}

	if ((firstSegment.a*p[thirdSegment].b.first + firstSegment.b*p[thirdSegment].b.second + firstSegment.c <= 0.0000001 &&
		secondSegment.a*p[thirdSegment].a.first + secondSegment.b*p[thirdSegment].a.second + secondSegment.c <= 0.0000001)) {
		ld f1 = calDistance(p[po.first].a, p[thirdSegment].b);
		ld f2 = calDistance(p[po.first].b, p[thirdSegment].b);
		ld f = calDistance(p[po.first].a, p[po.first].b);
		ld s1 = calDistance(p[po.second].a, p[thirdSegment].a);
		ld s2 = calDistance(p[po.second].b, p[thirdSegment].a);
		ld s = calDistance(p[po.second].a, p[po.second].b);

		if (f1 + f2 <= f + 0.0000001 && s1 + s2 <= s + 0.0000001) {
			if (f1 / f2 >= 0.25 && f1 / f2 <= 4 && s1 / s2 >= 0.25 && s1 / s2 <= 4) {
				return true;
			}
		}
	}

	return false;
}

// tính số đo góc kẹp giữa
inline double calAngleBetween() {
	p2ld A = solveTQE2H(p[po.first], firstSegment);
	p2ld B = solveTQE2H(p[po.second], secondSegment);

	ld dot = fabs(A.first*B.first + A.second*B.second);
	ld d1 = sqrt(p(A.first) + p(A.second));
	ld d2 = sqrt(p(B.first) + p(B.second));

	return acos(dot / (d1*d2))*(180.0 / pi);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	cin >> tc;

	while (tc--) {
		cou = 0;

		forn(i, 3, 0) {
			cin >> p[i].a.first >> p[i].a.second >> p[i].b.first >> p[i].b.second;
		}

		po = findSamePoint();

		if (3 - po.first - po.second <= 2) {
			double angleBetween = calAngleBetween();

			if (angleBetween <= 90 && angleBetween > 0) {
				if (isAc()) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//=============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
typedef pair<ld, ld> p2ld;
typedef pair<char, char> pcc;
//=============================================================================================

struct coor {
	ll x, y;

	friend istream &operator >> (istream &is, coor &A) {
		is >> A.x >> A.y;
		return is;
	}

	friend inline bool operator== (const coor &A, const coor &B) {
		return A.x == B.x && A.y == B.y;
	}

	friend inline double calDistance(const coor &a, const coor &b) {
		return sqrt((double)p(b.x - a.x) + (double)p(b.y - a.y));
	}

	friend inline pair<ll, ll> calVector(const coor &A, const coor &B) {
		return{ B.x - A.x, B.y - A.y };
	}
};

pair<coor, coor> p[3];

inline pii findSamePoints() {
	forn(i, 2, 0) {
		forn(j, 3, i + 1) {
			if (p[i].first == p[j].first || p[i].first == p[j].second || p[i].second == p[j].first || p[i].second == p[j].second) {
				return{ i, j };
			}
		}
	}

	return{ -1, -1 };
}

inline bool calAngleBetween(const pii &sp) {
	p2ll AB = calVector(p[sp.first].first, p[sp.first].second);
	p2ll CD = calVector(p[sp.second].first, p[sp.second].second);
	double head = (AB.first*CD.first + AB.second*CD.second);
	double bot = sqrt(AB.first*AB.first*1.0 + AB.second*AB.second*1.0) * sqrt(CD.first*CD.first*1.0 + CD.second*CD.second*1.0);
	double deg = acos(fabs(head / bot))*(180.0 / pi);

	return deg > 0 && deg <= 90;
}

inline bool isIntoSegment(int in, const coor &A) {
	double d = calDistance(p[in].first, p[in].second);
	double d1 = calDistance(p[in].first, A);
	double d2 = calDistance(p[in].second, A);

	return (d == d1 + d2 && 0.25 <= d1 / d2 && d1 / d2 <= 4);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	int tc;

	cin >> tc;

	while (tc--) {
		cin >> p[0].first >> p[0].second;
		cin >> p[1].first >> p[1].second;
		cin >> p[2].first >> p[2].second;

		if (p[0].first == p[0].second || p[1].first == p[1].second || p[2].first == p[2].second) {
			cout << "NO" << endl;
			continue;
		}

		pii sp = findSamePoints();

		if (sp.first != -1 && sp.second != -1) {
			if (p[sp.first].first == p[sp.second].second) {
				swap(p[sp.second].first, p[sp.second].second);
			}
			else if (p[sp.first].second == p[sp.second].first) {
				swap(p[sp.first].first, p[sp.first].second);
			}

			if (calAngleBetween(sp)) {
				int it = 3 - sp.first - sp.second;

				if (isIntoSegment(sp.first, p[it].first) && isIntoSegment(sp.second, p[it].second)) {
					cout << "YES" << endl;
					continue;
				}
				else if (isIntoSegment(sp.first, p[it].second) && isIntoSegment(sp.second, p[it].first)) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#pragma warning(disable:4996)
#include <bits\stdc++.h>
using namespace std;

//=============================================================================================
const double pi = 3.14159265359;
#define p(a) ((a) * (a))
#define forn(i, n, s) for (int i = s; i < n; ++i)
#define forp(i, n, s) for (int i = s; i > n; --i)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> p2ll;
typedef pair<string, int> psi;
typedef pair<ld, ld> p2ld;
typedef pair<char, char> pcc;
//=============================================================================================

struct coor {
	ll x, y;

	friend istream &operator >> (istream &is, coor &A) {
		is >> A.x >> A.y;
		return is;
	}

	friend inline bool operator== (const coor &A, const coor &B) {
		return A.x == B.x && A.y == B.y;
	}

	friend inline double calDistance(const coor &a, const coor &b) {
		return sqrt((double)p(b.x - a.x) + (double)p(b.y - a.y));
	}
};

pair<coor, coor> p[3];

inline pii findSamePoints() {
	forn(i, 2, 0) {
		forn(j, 3, i + 1) {
			if (p[i].first == p[j].first || p[i].first == p[j].second || p[i].second == p[j].first || p[i].second == p[j].second) {
				return{ i, j };
			}
		}
	}

	return{ -1, -1 };
}

inline bool calAngleBetween(const pii &sp) {
	ld AB = calDistance(p[sp.first].first, p[sp.first].second);
	ld AC = calDistance(p[sp.second].first, p[sp.second].second);
	ld BC = calDistance(p[sp.first].second, p[sp.second].second);

	if (AB && AC && BC && AB + AC > BC && AB + BC > AC && BC + AC > AB) {
		double deg = acos((p(AB) + p(AC) - p(BC)) / (2 * AB*AC))*(180.0 / pi);

		return 0 < deg && deg <= 90;
	}

	return false;
}

inline bool isIntoSegment(int in, const coor &A) {
	double d = calDistance(p[in].first, p[in].second);
	double d1 = calDistance(p[in].first, A);
	double d2 = calDistance(A, p[in].second);

	return (d && d1 && d2 && d - (d1 + d2) <= 0.0000001 && 0.25 <= d1 / d2 && d1 / d2 <= 4);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);

	int tc;

	cin >> tc;

	while (tc--) {
		cin >> p[0].first >> p[0].second;
		cin >> p[1].first >> p[1].second;
		cin >> p[2].first >> p[2].second;

		if (p[0].first == p[0].second || p[1].first == p[1].second || p[2].first == p[2].second) {
			cout << "NO" << endl;
			continue;
		}

		pii sp = findSamePoints();

		if (sp.first != -1 && sp.second != -1) {
			if (p[sp.first].first == p[sp.second].second) {
				swap(p[sp.second].first, p[sp.second].second);
			}
			else if (p[sp.first].second == p[sp.second].first) {
				swap(p[sp.first].first, p[sp.first].second);
			}
			else if (p[sp.first].second == p[sp.second].second) {
				swap(p[sp.first].first, p[sp.first].second);
				swap(p[sp.second].first, p[sp.second].second);
			}

			if (calAngleBetween(sp)) {
				int it = 3 - sp.first - sp.second;

				if (isIntoSegment(sp.first, p[it].first) && isIntoSegment(sp.second, p[it].second)) {
					cout << "YES" << endl;
					continue;
				}
				else if (isIntoSegment(sp.first, p[it].second) && isIntoSegment(sp.second, p[it].first)) {
					cout << "YES" << endl;
					continue;
				}
			}
		}

		cout << "NO" << endl;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

void solve() {
	string s; cin >> s;
	FOR(i, 0, sz(s)) {
		if (s[i] >= 'a' && s[i] <= 'z') {
			s[i] = ' ';
		}
	}
	stringstream ss(s);
	long double ans = 0;
	string tmp;
	while (ss >> tmp) {
		if (sz(tmp) >= 3 && tmp[sz(tmp) - 3] == '.') {
			string tmp2;
			FOR(i, 0, sz(tmp) - 3) if (tmp[i] != '.') {
				tmp2 += tmp[i];
			}
			FOR(i, sz(tmp) - 3, sz(tmp)) {
				tmp2 += tmp[i];
			}
			stringstream ss2(tmp2);
			long double val; ss2 >> val;
			ans += val;
		}
		else {
			string tmp2;
			FOR(i, 0, sz(tmp)) if (tmp[i] != '.') {
				tmp2 += tmp[i];
			}
			stringstream ss2(tmp2);
			long double val; ss2 >> val;
			ans += val;
		}
	}
	int t = (int) floor(ans);
	vi v;
	int tot = 0;
	while (t) {
		if (tot % 3 == 0 && tot) v.pb(-1);
		v.pb(t % 10);
		t /= 10;
		tot++;
	}
	reverse(all(v));
	if (!sz(v)) v.pb(0);
	if (floor(ans) < ans) {
		v.pb(-1);
		long long t = (long long) floor(ans * 100);
		if (t % 100 < 10) v.pb(0);
		v.pb(t % 100);
	}
	FOR(i, 0, sz(v)) {
		if (v[i] == -1) {
			cout << ".";
		}
		else cout << v[i];
	}
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

void solve() {
	string s; cin >> s;
	FOR(i, 0, sz(s)) {
		if (s[i] >= 'a' && s[i] <= 'z') {
			s[i] = ' ';
		}
	}
	stringstream ss(s);
	long double ans = 0;
	string tmp;
	while (ss >> tmp) {
		if (sz(tmp) >= 3 && tmp[sz(tmp) - 3] == '.') {
			string tmp2;
			FOR(i, 0, sz(tmp) - 3) if (tmp[i] != '.') {
				tmp2 += tmp[i];
			}
			FOR(i, sz(tmp) - 3, sz(tmp)) {
				tmp2 += tmp[i];
			}
			stringstream ss2(tmp2);
			long double val; ss2 >> val; val += EPS;
			ans += val;
		}
		else {
			string tmp2;
			FOR(i, 0, sz(tmp)) if (tmp[i] != '.') {
				tmp2 += tmp[i];
			}
			stringstream ss2(tmp2);
			long double val; ss2 >> val; val += EPS;
			ans += val;
		}
	}
	int t = (int) floor(ans);
	vi v;
	int tot = 0;
	while (t) {
		if (tot % 3 == 0 && tot) v.pb(-1);
		v.pb(t % 10);
		t /= 10;
		tot++;
	}
	reverse(all(v));
	if (!sz(v)) v.pb(0);
	if (floor(ans) < ans) {
		long long t = (long long) floor(ans * 100);
		if (t % 100) {
			v.pb(-1);
			if (t % 100 < 10) v.pb(0);
			v.pb(t % 100);
		}
	}
	FOR(i, 0, sz(v)) {
		if (v[i] == -1) {
			cout << ".";
		}
		else cout << v[i];
	}
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

void solve() {
	string s; cin >> s;
	FOR(i, 0, sz(s)) {
		if (s[i] >= 'a' && s[i] <= 'z') {
			s[i] = ' ';
		}
	}
	stringstream ss(s);
	long double ans = 0;
	string tmp;
	while (ss >> tmp) {
		if (sz(tmp) >= 3 && tmp[sz(tmp) - 3] == '.') {
			string tmp2;
			FOR(i, 0, sz(tmp) - 3) if (tmp[i] != '.') {
				tmp2 += tmp[i];
			}
			FOR(i, sz(tmp) - 3, sz(tmp)) {
				tmp2 += tmp[i];
			}
			stringstream ss2(tmp2);
			long double val; ss2 >> val; val += EPS;
			ans += val;
		}
		else {
			string tmp2;
			FOR(i, 0, sz(tmp)) if (tmp[i] != '.') {
				tmp2 += tmp[i];
			}
			stringstream ss2(tmp2);
			long double val; ss2 >> val; val += EPS;
			ans += val;
		}
	}
	int t = (int) floor(ans);
	vi v;
	int tot = 0;
	while (t) {
		if (tot % 3 == 0 && tot) v.pb(-1);
		v.pb(t % 10);
		t /= 10;
		tot++;
	}
	reverse(all(v));
	if (!sz(v)) v.pb(0);
	if (floor(ans) < ans) {
		v.pb(-1);
		long long t = (long long) floor(ans * 100);
		if (t % 100 < 10) v.pb(0);
		v.pb(t % 100);
	}
	FOR(i, 0, sz(v)) {
		if (v[i] == -1) {
			cout << ".";
		}
		else cout << v[i];
	}
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <iomanip>
using namespace std;
const long INF = 1'234'567'89;
string a, help = "", help1;
int ans = 0, s = 0, k, i;
string answ1 = "", ost1 = "";
int ost = 0;
int main()
{
	cin >> a;
	k = a.size();
	for (i = 0; i < k; i++)
	{
		if (a[i] >= '0'  && a[i] <= '9' || a[i] == '.') {
			help += a[i];
			if (i == k - 1)
			{
				help1 = "";
				ost1 = "";
				s = 0;
				for (int i = help.size() - 1; i > -1; i--)
				{
					if (help[i] == '.') break;
					else s++;
				}
				if (s == 2)
				{
					for (int g = 0; g < help.size() - 3; g++)
					{
						if (help[g] == '.') help.erase(help.begin() + g);
					}
					{
						for (int j = help.size() - 1; j > help.size() - 3; j--)
						{
							ost1 += help[j];
						}
					}
					reverse(ost1.begin(), ost1.end());
					for (int f = 0; f < help.size() - 3; f++) help1 += help[f];
				}
				else
				{
					for (int g = 0; g < help.size(); g++)
					{
						if (help[g] != '.') help1 += help[g];
					}
				}
				ans += atoi(help1.c_str());
				ost += atoi(ost1.c_str());
				help = "";
			}
		}
			else
			{
				help1 = "";
				ost1 = "";
				s = 0;
				for (int i = help.size() - 1; i > -1; i--)
				{
					if (help[i] == '.') break;
					else s++;
				}
				if (s == 2)
				{
					for (int g = 0; g < help.size() - 3; g++)
					{
						if (help[g] == '.') help.erase(help.begin() + g);
					}
					{
						for (int j = help.size() - 1; j > help.size() - 3; j--)
						{
							ost1 += help[j];
						}
					}
					reverse(ost1.begin(), ost1.end());
					for (int f = 0; f < help.size() - 3; f++) help1 += help[f];
				}
				else
				{
					for (int g = 0; g < help.size(); g++)
					{
						if (help[g] != '.') help1 += help[g];
					}
			}
				ans += atoi(help1.c_str());
				ost += atoi(ost1.c_str());
				help = "";
		}
	}
	vector <int> end_answ;
	if (ost > 99) {
		ans += ost - 99;
		ost -= 100;
	}
	if (ans) {
		while (ans)
		{
			end_answ.push_back(ans % 10);
			ans /= 10;
		}
		reverse(end_answ.begin(), end_answ.end());
		for (int i = 0; i < end_answ.size(); i++)
		{
			cout << end_answ[i];
			if ((end_answ.size() - (i + 1)) % 3 == 0 && (end_answ.size() - (i + 1))) cout << '.';
		}
	}
	else cout << 0;
	if (ost) {
		cout << ".";
		if (ost / 10 % 10 == 0) cout << 0;
		cout << ost;
	}
	return 0;
	}


#include <iostream>
#include <vector>
#include <string>
#include <iomanip>
#include <algorithm>
using namespace std;
const long INF = 1'234'567'89;
string a, help = "", help1;
int ans = 0, s = 0, k, i;
string answ1 = "", ost1 = "";
int ost = 0;
int main()
{
	cin >> a;
	k = a.size();
	for (i = 0; i < k; i++)
	{
		if (a[i] >= '0'  && a[i] <= '9' || a[i] == '.') {
			help += a[i];
			if (i == k - 1)
			{
				help1 = "";
				ost1 = "";
				s = 0;
				for (int i = help.size() - 1; i > -1; i--)
				{
					if (help[i] == '.') break;
					else s++;
				}
				if (s == 2)
				{
					for (int g = 0; g < help.size() - 3; g++)
					{
						if (help[g] == '.') help.erase(help.begin() + g);
					}
					{
						for (int j = help.size() - 1; j > help.size() - 3; j--)
						{
							ost1 += help[j];
						}
					}
					reverse(ost1.begin(), ost1.end());
					for (int f = 0; f < help.size() - 3; f++) help1 += help[f];
				}
				else
				{
					for (int g = 0; g < help.size(); g++)
					{
						if (help[g] != '.') help1 += help[g];
					}
				}
				ans += atoi(help1.c_str());
				ost += atoi(ost1.c_str());
				help = "";
			}
		}
			else
			{
				help1 = "";
				ost1 = "";
				s = 0;
				for (int i = help.size() - 1; i > -1; i--)
				{
					if (help[i] == '.') break;
					else s++;
				}
				if (s == 2)
				{
					for (int g = 0; g < help.size() - 3; g++)
					{
						if (help[g] == '.') help.erase(help.begin() + g);
					}
					{
						for (int j = help.size() - 1; j > help.size() - 3; j--)
						{
							ost1 += help[j];
						}
					}
					reverse(ost1.begin(), ost1.end());
					for (int f = 0; f < help.size() - 3; f++) help1 += help[f];
				}
				else
				{
					for (int g = 0; g < help.size(); g++)
					{
						if (help[g] != '.') help1 += help[g];
					}
			}
				ans += atoi(help1.c_str());
				ost += atoi(ost1.c_str());
				help = "";
		}
	}
	vector <int> end_answ;
	if (ost > 99) {
		while (ost > 99)
		{
			ans++;
			ost -= 100;
		}
	}
	if (ans) {
		while (ans)
		{
			end_answ.push_back(ans % 10);
			ans /= 10;
		}
		reverse(end_answ.begin(), end_answ.end());
		for (int i = 0; i < end_answ.size(); i++)
		{
			cout << end_answ[i];
			if ((end_answ.size() - (i + 1)) % 3 == 0 && (end_answ.size() - (i + 1))) cout << '.';
		}
	}
	else cout << 0;
	if (ost) {
		cout << ".";
		if (ost / 10 % 10 == 0) cout << 0;
		cout << ost;
	}
	return 0;
	}


#include <bits/stdc++.h>

using namespace std;

int main(){

      string str; cin >> str;

      int Main = 0;
      int Kp = 0;

      for (int i = 0; i < str.size(); ) {
            if ('0' <= str[i] && str[i] <= '9') {
                  string cost = "";
                  int j = 0;
                  while ( ('0' <= str[i + j] && str[i + j] <= '9') || str[i+j] == '.' ) {
                        cost += str[i + j];
                        j++;
                  }
                  if (cost.size() > 3) {
                        int N = cost.size();
                        if (cost[N - 3] == '.') {
                              string qw = cost.substr(0, cost.size() - 2);
                              string kp = cost.substr(cost.size() - 2, cost.size());
                              Kp += stoi(kp);
                              string temp = "";
                              for (char c : qw) {
                                    if (c != '.')
                                          temp += c;
                              }
                              Main += stoi(temp);
                        }
                        else {
                              string temp = "";
                              for (int j = 0; j < cost.size(); ++j) {
                                    if (cost[j] != '.')
                                          temp += cost[j];
                              }
                              Main += stoi(temp);
                        }
                  }
                  else {
                        string temp = "";
                        for (int j = 0; j < cost.size(); ++j) {
                              if (cost[j] != '.')
                                    temp += cost[j];
                        }
                        Main += stoi(temp);
                  }
                  i += j;
            }
            else {
                  i += 1;
            }
      }

      while (Kp > 99) {
            Kp -= 100;
            Main++;
      }

      if (Main == 0 && Kp == 0) {
            cout << 0;
      }
      else if (Main != 0 && Kp == 0) {
            string out = to_string(Main);
            vector <int> d;
            for (int i = out.size()-1, cnt = 0; i > -1; --i, cnt++) {
                  if (cnt % 3 == 2) {
                        d.push_back(i - 1);
                  }
            }
            reverse(d.begin(), d.end());
            for (int i = 0; i < out.size(); ++i) {
                  cout << out[i];
                  if (binary_search(d.begin(), d.end(), i)) {
                        cout << '.';
                  }
            }
      }
      else if (Main == 0 && Kp != 0) {
            cout << "0.";
            printf("%02d", Kp);
      }
      else {
            string out = to_string(Main);
            vector <int> d;
            for (int i = out.size() - 1, cnt = 0; i > -1; --i, cnt++) {
                  if (cnt % 3 == 2) {
                        d.push_back(i - 1);
                  }
            }
            reverse(d.begin(), d.end());
            for (int i = 0; i < out.size(); ++i) {
                  cout << out[i];
                  if (binary_search(d.begin(), d.end(), i)) {
                        cout << '.';
                  }
            }
            cout << ".";
            printf("%02d", Kp);
      }

      return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <iomanip>
#include <algorithm>
using namespace std;
const long INF = 1'234'567'89;
string a, help = "", help1;
int ans = 0, s = 0, k, i;
string answ1 = "", ost1 = "";
int ost = 0;
int main()
{
	cin >> a;
	k = a.size();
	for (i = 0; i < k; i++)
	{
		if (a[i] >= '0'  && a[i] <= '9' || a[i] == '.') {
			help += a[i];
			if (i == k - 1)
			{
				help1 = "";
				ost1 = "";
				s = 0;
				for (int i = help.size() - 1; i > -1; i--)
				{
					if (help[i] == '.') break;
					else s++;
				}
				if (s == 2)
				{
					for (int g = 0; g < help.size() - 3; g++)
					{
						if (help[g] == '.') help.erase(help.begin() + g);
					}
					{
						for (int j = help.size() - 1; j > help.size() - 3; j--)
						{
							ost1 += help[j];
						}
					}
					reverse(ost1.begin(), ost1.end());
					for (int f = 0; f < help.size() - 3; f++) help1 += help[f];
				}
				else
				{
					for (int g = 0; g < help.size(); g++)
					{
						if (help[g] != '.') help1 += help[g];
					}
				}
				ans += atoi(help1.c_str());
				ost += atoi(ost1.c_str());
				help = "";
			}
		}
			else
			{
				help1 = "";
				ost1 = "";
				s = 0;
				for (int i = help.size() - 1; i > -1; i--)
				{
					if (help[i] == '.') break;
					else s++;
				}
				if (s == 2)
				{
					for (int g = 0; g < help.size() - 3; g++)
					{
						if (help[g] == '.') help.erase(help.begin() + g);
					}
					{
						for (int j = help.size() - 1; j > help.size() - 3; j--)
						{
							ost1 += help[j];
						}
					}
					reverse(ost1.begin(), ost1.end());
					for (int f = 0; f < help.size() - 3; f++) help1 += help[f];
				}
				else
				{
					for (int g = 0; g < help.size(); g++)
					{
						if (help[g] != '.') help1 += help[g];
					}
			}
				ans += atoi(help1.c_str());
				ost += atoi(ost1.c_str());
				help = "";
		}
	}
	vector <int> end_answ;
	if (ost > 99) {
		ans += ost - 99;
		ost -= 100;
	}
	if (ans) {
		while (ans)
		{
			end_answ.push_back(ans % 10);
			ans /= 10;
		}
		reverse(end_answ.begin(), end_answ.end());
		for (int i = 0; i < end_answ.size(); i++)
		{
			cout << end_answ[i];
			if ((end_answ.size() - (i + 1)) % 3 == 0 && (end_answ.size() - (i + 1))) cout << '.';
		}
	}
	else cout << 0;
	if (ost) {
		cout << ".";
		if (ost / 10 % 10 == 0) cout << 0;
		cout << ost;
	}
	return 0;
	}


#include <iostream>
#include <vector>
#include <string>
#include <iomanip>
#include <algorithm>
using namespace std;
const long INF = 1'234'567'89;
string a, help = "", help1;
int ans = 0, s = 0, k, i;
string answ1 = "", ost1 = "";
int ost = 0;
int main()
{
	cin >> a;
	k = a.size();
	for (i = 0; i < k; i++)
	{
		if (a[i] >= '0'  && a[i] <= '9' || a[i] == '.') {
			help += a[i];
			if (i == k - 1)
			{
				help1 = "";
				ost1 = "";
				s = 0;
				for (int i = help.size() - 1; i > -1; i--)
				{
					if (help[i] == '.') break;
					else s++;
				}
				if (s == 2)
				{
					for (int g = 0; g < help.size() - 3; g++)
					{
						if (help[g] == '.') help.erase(help.begin() + g);
					}
					{
						for (int j = help.size() - 1; j > help.size() - 3; j--)
						{
							ost1 += help[j];
						}
					}
					reverse(ost1.begin(), ost1.end());
					for (int f = 0; f < help.size() - 3; f++) help1 += help[f];
				}
				else
				{
					for (int g = 0; g < help.size(); g++)
					{
						if (help[g] != '.') help1 += help[g];
					}
				}
				ans += atoi(help1.c_str());
				ost += atoi(ost1.c_str());
				help = "";
			}
		}
			else
			{
				help1 = "";
				ost1 = "";
				s = 0;
				for (int i = help.size() - 1; i > -1; i--)
				{
					if (help[i] == '.') break;
					else s++;
				}
				if (s == 2)
				{
					for (int g = 0; g < help.size() - 3; g++)
					{
						if (help[g] == '.') help.erase(help.begin() + g);
					}
					{
						for (int j = help.size() - 1; j > help.size() - 3; j--)
						{
							ost1 += help[j];
						}
					}
					reverse(ost1.begin(), ost1.end());
					for (int f = 0; f < help.size() - 3; f++) help1 += help[f];
				}
				else
				{
					for (int g = 0; g < help.size(); g++)
					{
						if (help[g] != '.') help1 += help[g];
					}
			}
				ans += atoi(help1.c_str());
				ost += atoi(ost1.c_str());
				help = "";
		}
	}
	vector <int> end_answ;
	if (ost > 99) {
		while (ost > 100)
		{
			ans++;
			ost -= 100;
		}
	}
	if (ans) {
		while (ans)
		{
			end_answ.push_back(ans % 10);
			ans /= 10;
		}
		reverse(end_answ.begin(), end_answ.end());
		for (int i = 0; i < end_answ.size(); i++)
		{
			cout << end_answ[i];
			if ((end_answ.size() - (i + 1)) % 3 == 0 && (end_answ.size() - (i + 1))) cout << '.';
		}
	}
	else cout << 0;
	if (ost) {
		cout << ".";
		if (ost / 10 % 10 == 0) cout << 0;
		cout << ost;
	}
	return 0;
	}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00,fr=0.00,in=0.00;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10.0)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    cout<<fixed<<setprecision(2);
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           ld y=(ll)x.ff+(x.ss*0.01);
           ans+=y;
       }
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00,fr=0.00,in=0.00;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10.0)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    cout<<fixed<<setprecision(2);
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           ld y=(ll)x.ff+(x.ss*0.01);
           ans+=y;
       }
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00;
    ll fr=0,in=0;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       ll in=0,fr=0;
       cout<<fixed<<setprecision(2);
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           in+=x.ff;
           fr+=x.ss;
       }
       in+=(fr/100);
       fr%=100;
       ans=in+(fr*0.01);
       cout<<fixed<<setprecision(2);
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00,fr=0.00,in=0.00;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10.0)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    cout<<fixed<<setprecision(2);
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           ld y=(ll)x.ff+(x.ss*0.01);
           ans+=y;
       }
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00,fr=0.00,in=0.00;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10.0)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       cout<<fixed<<setprecision(2);
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           ld y=(ll)x.ff+(x.ss*0.01);
           ans+=y;
       }
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00;
    ll fr=0,in=0;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       ll in=0,fr=0;
       cout<<fixed<<setprecision(2);
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           in+=x.ff;
           fr+=x.ss;
       }
       in+=(fr/100);
       fr%=100;
       ans=in+(fr*0.01);
       cout<<fixed<<setprecision(2);
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00,fr=0.00,in=0.00;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10.0)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10.0)+(s[i]-'0');
        }
    }
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       cout<<fixed<<setprecision(3);
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           ld y=(ll)x.ff+(x.ss*0.01);
           ans+=y;
       }
       cout<<fixed<<setprecision(2);
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00,fr=0.00,in=0.00;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10.0)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    cout<<fixed<<setprecision(2);
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           ld y=(ll)x.ff+(x.ss*0.01);
           ans+=y;
       }
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00,fr=0.00,in=0.00;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10.0)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    cout<<fixed<<setprecision(2);
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           ld y=(ll)x.ff+(x.ss*0.01);
           ans+=y;
       }
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00,fr=0.00,in=0.00;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10.0)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       cout<<fixed<<setprecision(3);
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           ld y=(ll)x.ff+(x.ss*0.01);
           ans+=y;
       }
       cout<<fixed<<setprecision(2);
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00;
    ll fr=0,in=0;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    //cout<<"in="<<fixed<<setprecision(2)<<in<<" "<<"fr="<<fr<<"\n";
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       ll in=0,fr=0;
       cout<<fixed<<setprecision(2);
       for(auto u:v)
       {
           x=func(u);
           //cout<<x.ff<<" "<<x.ss<<"\n";
           in+=x.ff;
           fr+=x.ss;
       }
       in+=(fr/100);
       fr%=100;
       ans=in+(fr*0.01);
       cout<<fixed<<setprecision(2);
       //cout<<ans<<"\n";
       cout<<func2(ans)<<"\n";
   }
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a)
{
    int ans=0;
    for (int i=0;i<s.length();i++)
         ans=(ans*10+(int)s[i]-'0')%a;
    return ans;
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y)
{
    if (y==0)
        return 1;
    else if (y%2==0)
        return power(x,y/2)*power(x,y/2);
    else
        return x*power(x,y/2)*power(x,y/2);
}
ll hcf(ll a,ll b)
{
    if(b==0)
        return a;
    return hcf(b,a%b);
}
pair<ld,ld> func(string s)
{
    ll i,n=s.length();
    ld ans=0.00;
    ll fr=0,in=0;
    if(s[n-3]=='.')
    {
        fr=(s[n-2]-'0')*10+(s[n-1]-'0');
        for(i=0;i<n-3;i++)
        {
         if(s[i]=='.')
          continue;
         in=(in*10)+(s[i]-'0');
         //cout<<s[i]-'0'<<"-"<<in<<" ";
        }
    }
    else
    {
        for(i=0;i<n;i++)
        {
            if(s[i]=='.')
             continue;
            in=(in*10)+(s[i]-'0');
        }
    }
    return {in,fr};
}
string func2(ld num)
{
    ll n,c=0;
    string s="";
    if(ceil(num)!=floor(num))
    {
        n=num*100;
        s+=(char)((n%10)+'0');
        n/=10;
        s+=(char)((n%10)+'0');
        s+='.';
        n/=10;
    }
    else
     n=num;
    while(n)
    {
        s+=(char)((n%10)+'0');
        n/=10;
        c++;
        if(c%3==0&&n)
         s+='.';
    }
    if(s[s.length()-1]=='.')
     s+='0';
    reverse(s.begin(),s.end());
    if(s[s.length()-1]=='0'&&s[s.length()-2]=='0'&&s[s.length()-3]=='.')
     s=s.substr(0,s.length()-3);
    return s;
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	freopen("error.txt", "w", stderr);
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       string s;
       cin>>s;
       ll n=s.length(),j,i;
       vector <string> v;
       for(i=0;i<n;)
       {
           if(s[i]>='a'&&s[i]<='z')
           {
            i++;
            continue;
           }
           else
           {
               string t="";
               for(j=i;j<n;j++)
               {
                   if(s[j]>='a'&&s[j]<='z')
                    break;
                   else
                    t+=s[j];
               }
               i=j;
               v.pb(t);
           }
       }
       pair <ld,ld> x;
       ld ans=0.00;
       ll in=0,fr=0;
       cout<<fixed<<setprecision(2);
       for(auto u:v)
       {
           x=func(u);
           in+=x.ff;
           fr+=x.ss;
       }
       in+=(fr/100);
       fr%=100;
       ans=in+(fr*0.01);
       cout<<fixed<<setprecision(2);
       cout<<func2(ans)<<"\n";
   }
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <queue>
#include <cstdio>
#include <fstream>
#include <unordered_map>
#include <map>
#include <iterator>
#include <iomanip>
#include <stack>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define TASK "payment"
#define X first
#define Y second
#define mp make_pair
#define inb push_back

int a[4];

int main()
{
	freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
	string s;
	cin >> s;
	int i = 0;
	while (i < s.size())
	{
		while (s[i] > '9')
			++i;
		int sm = 0, sm1 = 0, sm2 = 0, sm3 = 0, x = 1;
		string s1 = "";
		while (s[i] <= '9' && s[i] >= '0')
			s1 += (s[i] - '0'), ++i;
		for (int j = s1.size() - 1; j >= 0; --j)
			sm += s1[j] * x, x *= 10;
		if (s[i] != '.')
		{
			a[2] += sm;
			continue;
		}
		++i;
		int kl = 0;
		x = 1;
		s1 = "";
		while (s[i] <= '9' && s[i] >= '0')
			s1 += (s[i] - '0'), ++i, ++kl;
		for (int j = s1.size() - 1; j >= 0; --j)
			sm1 += s1[j] * x, x *= 10;
		if (s[i] != '.')
		{
			if (kl == 2)
			{
				a[2] += sm;
				a[3] += sm1;
			}
			else
			{
				a[1] += sm;
				a[2] += sm1;
			}
			continue;
		}
		kl = 0;
		++i;
		x = 1;
		s1 = "";
		while (s[i] <= '9' && s[i] >= '0')
			s1 += (s[i] - '0'), ++i, ++kl;
		for (int j = s1.size() - 1; j >= 0; --j)
			sm2 += s1[j] * x, x *= 10;
		if (s[i] != '.')
		{
			if (kl == 2)
			{
				a[1] += sm;
				a[2] += sm1;
				a[3] += sm2;
			}
			else
			{
				a[0] += sm;
				a[1] += sm1;
				a[2] += sm2;
			}
			continue;
		}
		++i;
		x = 1;
		s1 = "";
		while (s[i] <= '9' && s[i] >= '0')
			s1 += (s[i] - '0'), ++i;
		for (int j = s1.size() - 1; j >= 0; --j)
			sm3 += s1[j] * x, x *= 10;
		a[0] += sm;
		a[1] += sm1;
		a[2] += sm2;
		a[3] += sm3;
	}
	if (a[0])
	{
		cout << a[0] << '.';
		printf("%03d.%03d.%02d", a[1], a[2], a[3]);
	}
	else if (a[1])
	{
		cout << a[1] << '.';
		printf("%03d.%02d", a[2], a[3]);
	}
	else if (a[2])
	{
		cout << a[2] << '.';
		printf("%02d", a[3]);
	}
	else if (a[3])
	{
		cout << 0 << '.';
		printf("%02d", a[3]);
	}
	else
		cout << 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <queue>
#include <cstdio>
#include <fstream>
#include <unordered_map>
#include <map>
#include <iterator>
#include <iomanip>
#include <stack>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define TASK "payment"
#define X first
#define Y second
#define mp make_pair
#define inb push_back

int a[4];

int main()
{
	//freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
	string s;
	cin >> s;
	int i = 0;
	while (i < s.size())
	{
		while (s[i] > '9')
			++i;
		int sm = 0, sm1 = 0, sm2 = 0, sm3 = 0, x = 1;
		string s1 = "";
		while (s[i] <= '9' && s[i] >= '0')
			s1 += (s[i] - '0'), ++i;
		for (int j = s1.size() - 1; j >= 0; --j)
			sm += s1[j] * x, x *= 10;
		if (s[i] != '.')
		{
			a[2] += sm;
			continue;
		}
		++i;
		int kl = 0;
		x = 1;
		s1 = "";
		while (s[i] <= '9' && s[i] >= '0')
			s1 += (s[i] - '0'), ++i, ++kl;
		for (int j = s1.size() - 1; j >= 0; --j)
			sm1 += s1[j] * x, x *= 10;
		if (s[i] != '.')
		{
			if (kl == 2)
			{
				a[2] += sm;
				a[3] += sm1;
			}
			else
			{
				a[1] += sm;
				a[2] += sm1;
			}
			continue;
		}
		kl = 0;
		++i;
		x = 1;
		s1 = "";
		while (s[i] <= '9' && s[i] >= '0')
			s1 += (s[i] - '0'), ++i, ++kl;
		for (int j = s1.size() - 1; j >= 0; --j)
			sm2 += s1[j] * x, x *= 10;
		if (s[i] != '.')
		{
			if (kl == 2)
			{
				a[1] += sm;
				a[2] += sm1;
				a[3] += sm2;
			}
			else
			{
				a[0] += sm;
				a[1] += sm1;
				a[2] += sm2;
			}
			continue;
		}
		++i;
		x = 1;
		s1 = "";
		while (s[i] <= '9' && s[i] >= '0')
			s1 += (s[i] - '0'), ++i;
		for (int j = s1.size() - 1; j >= 0; --j)
			sm3 += s1[j] * x, x *= 10;
		a[0] += sm;
		a[1] += sm1;
		a[2] += sm2;
		a[3] += sm3;
	}
	if (a[3] > 99)
	{
		a[2] += a[3] / 100;
		a[3] %= 100;
	}
	if (a[2] > 999)
	{
		a[1] += a[2] / 1000;
		a[2] %= 1000;
	}
	if (a[1] > 999)
	{
		a[0] += a[1] / 1000;
		a[1] %= 1000;
	}
	if (a[0])
	{
		cout << a[0];
		printf(".%03d.%03d", a[1], a[2]);
		if (a[3])
			printf(".%02d", a[3]);
	}
	else if (a[1])
	{
		cout << a[1];
		printf(".%03d", a[2]);
		if (a[3])
			printf(".%02d", a[3]);
	}
	else if (a[2])
	{
		cout << a[2];
		if (a[3])
			printf(".%02d", a[3]);
	}
	else if (a[3])
	{
		cout << 0 << '.';
		printf("%02d", a[3]);
	}
	else
		cout << 0;
}