/** libraries */
#include
#include
#include
#include
#include
#include
#include
#include
/** libraries */
using namespace std;
/** defines */
#define ll long long
#define ld long double
#define yes cout << "YES" << "\n"</strong>
#define no cout << "NO" << "\n"</strong>
/** defines */
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ld x;
cin >> x;
if(x < 5)
cout << sin(2*x + 3);</strong>
else if(x < 8)
cout << 3*x + 2 * pow(x,3);</strong>
else
cout << (3*x-2)/(1 + pow(x,2));</strong>
}