#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    string s;
    cin >> s;
    cout << s[1] << s[2] << s[0] << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;

#define sz(x) (int)(x).size()

template <typename T> bool ckmin (T& a, T b) { return (b < a) ? a = b, 1 : 0; }
template <typename T> bool ckmax (T& a, T b) { return (b > a) ? a = b, 1 : 0; }

#ifdef XVENOM
  #define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: " << dbg_str(__VA_ARGS__)
#else
  #define dbg(...) ;
#endif
template <typename U, typename V> string to_string (pair<U, V>);
string to_string (const char* e) { return "\"" + string(e) + "\""; }
string to_string (string& e) { return "\"" + e + "\""; }
string to_string (char e) { return "\'" + string(1, e) + "\'"; }
string to_string (bool e) { return e ? "true" : "false"; }
template <typename T> string to_string (T e) {
  string s = "[ "; for (auto& x : e) s += to_string(x) + " "; return s + "]";
}
template <typename U, typename V> string to_string (pair<U, V> e) {
  return "(" + to_string(e.first) + ", " + to_string(e.second) + ")";
}
string dbg_str () { return " \n"; }
template <typename U, typename... V> string dbg_str (U u, V... v) {
  return " " + to_string(u) + dbg_str(v...);
}
/* *** */
int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);

  auto f = [&] (ll x) {
    ll res = 1;
    while (x--) res *= 10;
    return res;
  };

  ll n; cin >> n;
  ll ans = 0; 
  for (ll i = 0; i <= 5; i++) {
    ll lo = f(3 * i), hi = f(3 * i + 3) - 1;
    ckmin(hi, n);
    ans += i * (hi - lo + 1);
    if (hi == n) break;
  }
  cout << ans << '\n';
}

