#include using namespace std; double trigamma(double x) { x += 7; double p = 1 / x / x; p = (((((p * 5 / 66 - 1.0 / 30) * p + 1.0 / 42) * p - 1.0 / 30) * p + 1.0 / 6) * p + 1) / x + p / 2.0; for(int i = 0; i < 6; i++) { p = 1 / --x / x + p; } return (p); } int main() { double x; cin >> x; cout << fixed << setprecision(15) << trigamma(x) << endl; }