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

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	double d; cin >> d;

	double ans = sqrt(2) * d;
	if (d >= 1)
		ans = max(ans, floor(d) + 1);

	cout << fixed << setprecision(12) << ans << endl;
}

