#include <iostream>

using namespace std;

int main() {
    int x, y;
    cin >> x;
    if (x <= 0) {
          y = 2*x + 3;
          }
          else {
               if (x > 0 && x <= 100) {
                     y = (x * x * x) + 1;
                     }
                     else {
                          y = abs(x);
                          
               }
          
          }
    cout << y << endl;
    
    }
