#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
// 手動對字串數字的小數部分進行進位處理
void add_one(string &s, int idx) {
for (int i = idx; i >= 0; i--) {
if (s[i] == '.') continue; // 跳過小數點
if (s[i] == '9') {
s[i] = '0'; // 逢 9 進位變 0,繼續往左看
} else {
s[i]++; // 普通數字加 1 即可結束
return;
}
}
// 如果一路進位到最左邊都爆了(例如 9.995 變成 0.00),要在最前面補 1
s = "1" + s;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
while (cin >> s) {
// 1. 處理正負號
bool is_negative = false;
if (s[0] == '-') {
is_negative = true;
s = s.substr(1); // 拔掉負號方便後續處理
}
// 2. 找到小數點位置並補齊位數
size_t dot = s.find('.');
if (dot == string::npos) {
// 如果輸入是整數,直接補上 .00
s += ".000";
dot = s.find('.');
} else {
// 補足至少小數點後 3 位,方便我們觀察第 3 位
while (s.length() - 1 - dot < 3) {
s += "0";
}
}
// 3. 核心判定:觀察小數點後第 3 位 (dot + 3)
char third_digit = s[dot + 3];
if (third_digit >= '5') {
// 需要四捨五入進位,從倒數第 2 位 (dot + 2) 開始手動加 1
add_one(s, dot + 2);
}
// 重新尋找小數點(因為 add_one 可能會在最前面塞一個 "1" 導致位置偏移)
dot = s.find('.');
// 4. 截取到小數點後第 2 位
string ans = s.substr(0, dot + 3);
// 5. 防禦特殊狀況:如果進位完變成 "-0.00",要把負號吃掉,輸出 "0.00"
bool all_zero = true;
for (char c : ans) {
if (c >= '1' && c <= '9') {
all_zero = false;
break;
}
}
if (all_zero) {
cout << "0.00\n";
} else {
if (is_negative) cout << "-";
cout << ans << "\n";
}
}
return 0;
}