# include <iostream>
# include <string>

int main() {
	int a, b, e;
	std::string c, d;
	std::cin >> a;
	e = a;
	c = std::to_string(a);
	d = std::to_string(a);
	d = d.substr(0, d.length()-2);
	d += c[c.length() - 1];
	c = c.substr(0, c.length()-1);
	a = std::stoi(c);
	b = std::stoi(d);

	if (e > 0) std::cout << e;
	else if (a > b) std::cout << a;
	else std::cout << b;
	return 0;
}

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {

   int n;
   cin>>n;
   if(n>=0)
   cout<<n;
   else
   {int c= n%10;
   int s=n/10;
   int d= s%10;
   int m=s/10;
   if(abs(d)>abs(c))
   cout<<m*10+c;
   else cout<<s;

   }
}

#include <iostream>
using namespace std;
int main ()
{
  int n;
  cin>>n;
  if (n >=0)
  cout<<n<<endl;
  else
  {
    int n1=n/10;
    int n2=(n/100)*10+n%10;
    if(n1>n2)
    cout<<n1<<endl;
    else
    cout <<n2<<endl;

  }

  return 0;

}

#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <bitset>
#include <algorithm>
#include <cstring>

using namespace std;

#define rep(i,a,b) for(int i = (a); i < int(b); ++i)
#define rrep(i, a, b) for(int i = (a) - 1; i >= 0; --i)
#define trav(it, v) for(__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
#define all(v) (v).begin(), (v).end()

typedef double fl;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

int main(){
    string x;
    cin >> x;
    if(x[0] == '-'){
        x.erase(max_element(x.begin() + x.size() - 2, x.end()));
    }
    cout << atoi(x.c_str()) << endl;
}

#include<iostream>
#include<string>
#include<sstream>
#include<vector>
#include<algorithm>
using namespace std;
// acc :P
int main(){
    string s; cin >> s;
    string ld = s,bld=s;
    ld.erase(ld.size() - 1, 1);
    bld.erase(bld.size() - 2, 1);
    int n, m,nm;
    istringstream(ld) >> n;
    istringstream(bld) >> m;
    istringstream(s) >> nm;
    if (nm > n&&nm > m){ cout << nm << "\n"; return 0; }
    cout << (n>m ? n : m) << "\n";
}

#include <iostream>

using namespace std;

int main()
{
    string x , y , z ,s;
    cin >> x; s=x;
    if (x[0] == '-'){
        y = x.erase(x.size()-1 , 1);
        z = s.erase(s.size()-2 , 1);
        if (y[1] == '0' || z[1] == '0'){
            cout << "0" << endl;
        }
        else
        if (y < z){
            cout << y<< endl;
        }
        else{
            cout << z << endl;}
    }
    else
        cout << x<<endl;

    return 0;
}

#include<iostream>
using namespace std;
int main()  {
    int n;
    cin>>n;
    if(n>=0)
    cout<<n;
    else {
        int n1,n2;
        n1=n/10;
        n2=n1/10*10+n%10;
        if(n1>n2)
        cout<<n1;
        else
        cout<<n2;

    }

    return 0;
}

#include <iostream>
#include <sstream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <utility>
#include <cassert>
#include <numeric>
#include <sstream>
using namespace std;

#define REQUIRE(cond, message) \
    do { \
        if (!(cond)) { \
            std::cerr << message << std::endl; \
            assert(false); \
        } \
    } while (false)

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define forv(i, v) forn(i, (v).size())
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef long double ld;

void solve()
{
    int n; cin >> n;
    int ans = max(n, n / 10);
    while ((n / 10) % 10) n += 10 * ((n > 0) ? -1: 1);
    n = (n / 10) + (n % 10);
    cerr << n << endl;
    ans = max(ans, n);
    cout << ans << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
    return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <iterator>
#define print_vector(a) for (int i = 0; i < a.size(); i++) { if (i == a.size() - 1) {cout << a[i];} else { cout << a[i] << " ";}}
using namespace std;

int main () {
  int n;
  scanf("%d", &n);
  if (n >= 0) {
    printf("%d", n);
  } else {
    stringstream ss;
    ss << n;
    string s = ss.str();
    char last = s[s.size() - 1];
    char second_to_last = s[s.size() - 2];
    string a = s.substr(0, s.size() - 2) + last;
    string b = s.substr(0, s.size() - 2) + second_to_last;
    printf("%d", max(atoi(a.c_str()), atoi(b.c_str())));
  }
  fflush(stdout);
}

#include<stdio.h>
#include<string.h>
int main()
{
    int c,i;
    char n[100];
    scanf("%s",n);
    if(n[0]!='-')
        printf("%s\n",n);
    else
    {
        c=strlen(n);
        if(c==3)
        {
            if(n[2]=='0')
            {
                printf("0\n");
                return 0;
            }

        }
        if(n[c-1]>n[c-2])
            for(i=0; i<c-1; i++)
                printf("%c",n[i]);
        else if(n[c-1]<=n[c-2])
            for(i=0; i<c; i++)
            {
                if(i==c-2)
                    continue;
                printf("%c",n[i]);
            }

    }
    return 0;
}

//Pradeep_7
#include<vector>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<bitset>
#include<algorithm>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define IO ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define ll long long int
#define nn cout<<"\n"
using namespace std;
int main()
{
	IO;
	int a;
	cin>>a;
	int temp=a;
	if(a<0)
	{
		int f,l;
		f=abs(a%10);
		a=a/10;
		l=abs(a%10);
		if(f>l)
		{
			temp=temp/10;
		}
		else
		{
			f = temp%10;
			temp=temp/100;
			temp=temp*10;
			temp=temp+f;
		}
	}
	cout<<temp;
	nn;
}

#include<stdio.h>
#include<time.h>
#include<iostream>
#include<string.h>
#include<fstream>
#include<sstream>
#include<math.h>
#include<algorithm>
#include<vector>
#include<ctime>
#include<map>
#include<stack>
#include<iomanip>
#include<string.h>
#include<string>
#define pr printf
#define sc scanf
#define str strlen
#define rev reverse
#define ll long long int
#define in freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define inn freopen("expedition.in","r",stdin);
#define outt freopen("expedition.out","w",stdout);
using namespace std;
main()
{
      //  in out
      ll a;
      cin>>a;
      if(a>=0)
      {
          cout<<a<<endl;
          return 0;
      }
      ll b ,c ;
     b= abs(a%10);
     c=abs(a%100/10);
     if(b>=c)
     {
         if(a/100==0)
         cout<<-c<<endl;
    else  cout<<a/100<<c<<endl;
     }
     else {
         if(a/100==0)
         cout<<-b<<endl;
        else cout<<a/100<<b<<endl;
         }
    return 0;
}

#include<cstdio>
#include<cmath>

int main(){

	int n;
	scanf("%d", &n);

	if(n >= 0)
		printf("%d\n", n);
	if(n < 0){
		int last_digit, next_last_digit;
		last_digit = (-1*n)%10;
		next_last_digit = (-1*n)%100;
		int case_last, case_next_last;
		case_last = n/10;
		case_next_last = (n/100)*10 - last_digit;
		if(case_last > case_next_last)
			printf("%d\n", case_last);
		else
			printf("%d\n", case_next_last);
	}
	return 0;
}

//Pradeep_7
#include<vector>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<bitset>
#include<algorithm>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define IO ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define ll long long int
#define nn cout<<"\n"
using namespace std;
int main()
{
	IO;
	string a;
	cin>>a;
	if(a[0]=='-')
	{
		int n = a.size();
		if(a[n-1]-'0' > a[n-2]-'0')
		{
			a.erase(a.begin()+(n-1));
		}
		else
		{
			a.erase(a.begin()+(n-2));
		}
		if(a=="-0")
		{
			a="0";
		}
	}
	cout<<a;
	nn;
}

// Example program
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a,b,c;
cin>>a;
b=a/10;
c=(a/100)*10+a%10;
if(a>0)cout<<a;
else if(b>c)cout<<b;
else cout<<c;
}

#include <iostream>
using namespace std ;
int main ()
{
int N , N1 , N2 ;
cin >> N ;
if (N >=0)
cout << N <<endl;
 else
{ int N1, N2 ;

 N1 =N /10 ;
 N2 =( N/100) *10 + N%10 ;
 if (N1 >= N2)

 cout<< N1 <<endl ;
 else
 cout << N2 <<endl ;

}
  return 0 ;
  }

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

int main()
{

   signed long long int n , i, count = 0, q , r, p;
   cin >> n;
   p = n;

   if(n > 0){
       cout << n;
       while(p > 0){
       p = p/10;
       count++;
   }
   }else{
       p = abs(p);
       q = p/10;
       r = 10*q;
       int d = p - r;
       int f = p/100;
       int x = f*10 + d;
       if(q != 0 && x != 0){
            if(q < x){
           cout <<'-' << q;
       }else{
          cout << '-' << x;

       }
           }else{
              if(q < x){
           cout << q;
       }else{
          cout<< x;

       }
           }

   }

}

#include <iostream>
#include<iomanip>
using namespace std;

int main()
{
    int a;
    cin>>a;
    if(a>0) cout<<a;
    else if (a<0) {

        int m=a/10;
        int u=m/10*10+a%10;
        if(m>u) cout<<m;
        else cout<<u;
    }
}

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

long long a,r[100000],b,k,s,c,t,j,v,u,o,i,l,n,w,h[100000],d,m[1000000];
pair <long long, long long> x[11111];
string q,p;
char e;

int main() {

	cin >> p;
	a=p.size();

	if ( p[0]!='-'){
		cout << p;
		return 0;
	}

	if (p.size()==3 && p[2]=='0'){
	    cout << 0;
	    return 0;
	}
	for (i=0;i<p.size()-2;i++)
	        cout <<p[i];

    cout <<min (p[a-1],p[a-2]);

	}

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

const int n_max = 9 + 5;
const int INF = 0x3fffffff;
char number[n_max];
int sum, ans;

int main()
{
    while(~scanf("%s", number))
    {
        if(number[0] != '-')
        {
            printf("%s\n", number);
            continue;
        }
        else
        {
            int len = strlen(number);
            ans = INF;
            for(int i = len - 2; i <= len - 1; i ++)
            {
                sum = 0;
                char temp = number[i];
                number[i] = '0';
                for(int j = 1; j <= len - 1; j ++)
                {
                    if(j == i)
                        continue;
                    else
                        sum = sum * 10 + (number[j] - '0');
                }
                ans = min(ans, sum);
                number[i] = temp;
            }
            if(ans)
                printf("-%d\n", ans);
            else
                printf("0\n");
        }
    }
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
   int a;
   cin>>a;
   if(a>0)
   {
	   cout<<a<<endl;
   return 0;
   }
    int b;
   b=a/10;
   int c;
   c=a/100*10+a%10;

   if(b>c)
	   cout<<b<<endl;
   else
	   cout<<c<<endl;

}

#include<iostream>
#include<cmath>
using namespace std;
int main () {
   int a,n,m;
   cin>>a;
   if(a>=0)
   cout<<a;
   else if(a<0)
   { n=a/10;
   m=a/100*10+a%10;
   cout<<max(n,m) ; }
   return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
 {
  string s;
  cin>>s;
  int l=s.length();
   if(s[0]=='-'&&l==3&&s[l-1]=='0')
    cout<<"0";
  else if(s[0]=='-')
  {
      if(s[l-1]>s[l-2])
      {
          for(int i=0;i<=l-2;i++)
            cout<<s[i];
      }
      else
      {
                    for(int i=0;i<l-2;i++)
            cout<<s[i];
            cout<<s[l-1];
      }
  }
  else
    cout<<s;

         cout<<endl;
 }

#include <iostream>
#include <cmath>
using namespace std;
int main() {

int n ;
cin>>n;

if (n>=0)
cout<<n<<endl;
else

{
  int n1 , n2 ;
  n1 = n/10 ;
  n2 = (n/100)*10+n%10;
  if(n1>n2) cout << n1;
  else
  cout<< n2 ;
}

return 0 ;
}

#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
int n;
cin>>n;
cout<<max(n, max(n/10, (n/100)*10 +n%10));
return 0;
}

# include <iostream>
using namespace  std ;

int main()
{
 int n ,t;

 cin>>n;
if(n>=0) cout<<n;
else{
int n1=n/10;
 t=n%10;
int n2=(n/100)*10+t;
if(n1>n2) cout<<n1;
else
cout<<n2;
}
return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
int n,tmp1,tmp2;cin>>n;
if(n<0){
    tmp1=(n/100)*10+n%10;
    tmp2=n/10;
        if(tmp1>tmp2){
            cout<<tmp1<<endl;
        }
        else{
            cout<<tmp2<<endl;
        }
    }else{
        cout<<n<<endl;
    }
return 0;
}

#include <iostream>
using namespace std;

int main() {
    int n;
    cin>>n;
    if(n>0)
    {cout<<n;}
    else if(n%-10==0&&(n*-1)<100)
    cout<<"0";
    else
    {
        n*=-1;
        int x=n;
        int last=n%10;
        int blast=n%100;
        blast-=last;
        blast/=10;
    if(last>=blast)
    {
        n/=10;
        if(n==0)
        cout<<"0";
        else
        cout<<"-"<<n;
    }
    else if(blast>last)
    {
        if(n<100)
        {
            n/=10;
        }
        else
        {n/=100;}
        if(n==0)
            cout<<n;
        else if((x/10)<10)
            cout<<"-"<<last;
        else
        cout<<"-"<<n<<last;
    }}
    return 0;
}

#include<iostream>
using namespace std;

int main()
{
    int n;
    cin>>n;
    if(n>=0)
    {
        cout<< n;
        return 0;
    }
    else
    {
        int hold=n;
        int f=-1*hold%10;
        //cout<< f<< endl;
        hold=hold/10;
        //cout<< hold<<endl;
        int s=-1*hold%10;
        //cout<<s<<endl;
        if(f>=s)
        {
            n=n/10;
            //cout<<n<<endl;
        }
        else
        {
            n=(n/100);
            //cout<<n<<endl;
            n=n*10 -f;
            //cout<<n<<endl;
        }
        cout<< n;
    }
    return 0;
}

#include<bits/stdc++.h>

#define x first

#define y second

#define eps 1e-7

#define pb push_back

#define inf 0x3f3f3f3f

#define mod 1000000007

#define sq(x) ((x)*(x))

#define cb(x) ((x)*(x)*(x))

#define bit(x, y) (((x)>>(y))&1)

#define bctz(x) (__builtin_ctz(x))

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzl(x))

#define bctzl(x) (__builtin_ctzl(x))

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define pi 3.1415926535897932384626433832795

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

using namespace std;

typedef double DO;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

template<typename T, typename U> inline void smin(T &a, U b) {if(a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if(a<b) a=b;}

template <class T> inline void gn(T &x) {char c, sg=0; while(c=getchar(), (c>'9' || c<'0') && c!='-'); for((c=='-' ? sg=1, c=getchar() : 0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0'; if(sg) x=-x;}

template <class T1, class T2> inline void gn(T1 &x1, T2 &x2) {gn(x1), gn(x2);}

template <class T1, class T2, class T3> inline void gn(T1 &x1, T2 &x2, T3 &x3) {gn(x1, x2), gn(x3);}

template <class T1, class T2, class T3, class T4> inline void gn(T1 &x1, T2 &x2, T3 &x3, T4 &x4) {gn(x1, x2), gn(x3, x4);}

template <class T> inline void print(T x) {if(x<0) {putchar('-'); return print(-x);} if(x<10) {putchar('0'+x); return ;} print(x/10); putchar(x%10+'0');}

template <class T> inline void println(T x) {print(x); putchar('\n');}

template <class T> inline void printsp(T x) {print(x); putchar(' ');}

template <class T1, class T2> inline void print(T1 x1, T2 x2) {printsp(x1), println(x2);}

template <class T1, class T2, class T3> inline void print(T1 x1, T2 x2, T3 x3) {printsp(x1), printsp(x2), println(x3);}

template <class T1, class T2, class T3, class T4> inline void print(T1 x1, T2 x2, T3 x3, T4 x4) {printsp(x1), printsp(x2), printsp(x3), println(x4);}

int power(int a, int b, int m, int ans=1) {

	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;

	return ans;

}

#define NN 122

int a[NN];

int nn;

string s;

set<string> se;

void solve(int id) {

	s.clear();

	for(int i=0; i<nn; i++) if(i!=id) s.pb('0'+a[i]);

	if(s[0]!='0') se.insert(s);

	else if(s.size()==1) se.insert(s);

}

int main() {

#ifndef	ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

#endif

	int n;

	gn(n);

	if(n>=0) {

		println(n);

		return 0;

	}

	n=-n;

	while(n) {

		a[nn++]=n%10;

		n/=10;

	}

	reverse(a, a+nn);

	for(int i=nn-2; i<nn; i++) solve(i);

	if(se.empty()) {

		putchar('-');

		for(int i=0; i<nn; i++) print(a[i]);

	}

	else {

		string ans=*se.begin();

		if(ans[0]=='0') cout<<ans<<endl;

		else cout<<'-'<<ans<<endl;

	}

}

#pragma comment(linker, "/STACK:16777216")
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#ifndef ONLINE_JUDGE
#define Eo(x) { cerr << #x << " = " << (x) << endl; }
#else
#define Eo(x)
#endif

typedef long long int64;
const int inf = 0x3f3f3f3f;
const int64 inf64 = 0x3f3f3f3f3f3f3f3fLL;
typedef double real;
const real eps = 1e-6;
typedef pair<int64,int64> pip;

template <typename A,typename B>
ostream& operator<<(ostream& os, const pair<A,B>& p) {
	return os << p.first << "," << p.second;
}

template <typename A>
ostream& operator<<(ostream& os, const vector<A>& v) {
	for (int i = 0; i < v.size(); i++) {
		os << v[i] << ";";
	}
	return os;
}

template <typename A>
ostream& operator<<(ostream& os, const set<A>& v) {
	for (typename set<A>::const_iterator it = v.begin(); it != v.end(); ++it) {
		os << *it << ";";
	}
	return os;
}

template <typename A, typename B>
ostream& operator<<(ostream& os, const map<A,B>& v) {
	for (typename map<A,B>::const_iterator it = v.begin(); it != v.end(); ++it) {
		os << it->first << "=" << it->second << ";";
	}
	return os;
}

int main() {
	int64 n; cin >> n;
	if (n>=0) {
		cout << n << endl;
		return 0;
	}
	int64 a = n/10;
	int64 b = (n/100)*10+(n%10);
	cout << max({n,a,b}) << endl;
	return 0;
}

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
using namespace std;

int main()
{
	char arr1[12] ;
	cin >> arr1 ;
	if(arr1[0] == '-')
	{

		if(arr1[strlen(arr1) - 2] > arr1[strlen(arr1) - 1])
		{
			arr1[strlen(arr1) - 2] = arr1[strlen(arr1) - 1] ;
			arr1[strlen(arr1) - 1] = 0;
			if(arr1[1] == '0')
				cout << 0 << endl;
			else
				cout<< arr1 << endl ;
		}
		else
		{
			arr1[strlen(arr1) - 1] = 0;
			if(arr1[1] == '0')
				cout << 0 << endl;
			else
				cout<< arr1 << endl ;
		}
	}
	else
		cout << arr1 <<endl ;

return 0;
}

# include <set>
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<vector>
#include<string>
#include<iomanip>
# include <cmath>
 #define ll long long
using namespace std;;
   long long a[1000001]={0},n;
int main(){
   //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin>>n;
    if (n>=0) {cout<<n; return 0;}
    n=abs(n);
    if (n%10>=(n/10)%10) cout<<-n/10;
    else {if (n/100==n%10 && n%10==0)
     {cout<<0;return 0;};
     if (n/100>0) cout<<-(n/100); else cout<<'-';;
     cout<<n%10;}
         return 0;
}

#include <iostream>
#include < sstream >
using namespace std;

int main ()
{
int x;
    string s;

    cin >> x;

    stringstream ss;

    ss<< x;
    ss>> s;

    if ( x <= 0)
    {
    int size;
    size = s.length();

        if (s.at(size-2)> s.at(size-1))
        {
            s.erase(size-2,1);
        }
        else
        s.erase(size-1,1);
        }
    ss.clear();
    ss.str("");
    ss << s ;
    ss>>x;
    cout<<x<<endl;

}

#include <iostream>
#include<sstream>
#include<string>
using namespace std;
int main() {
int n; cin>>n;
string s;
stringstream sss;
sss << n;
s = sss.str();
 if(n>=0) cout<<n;
 else
if((s.length()<3)|| ( (n/10>-10) && (n%10==0) ) ) cout<<"0";
else {
for(int i=0;i<=s.length()-3;i++)
cout<<s[i]; cout<<min(s[s.length()-1],s[s.length()-2]);}

 return 0;
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    int n, a, b, ans;
    cin >> n;
    if (n > 0) {
        cout << n;
        return 0;
    }
    n *= -1;
    a = n / 10;
    b = n / 100;
    b *= 10;
    b += n % 10;
    ans = min(a, b);
    ans *= -1;
    cout << ans;
}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
using namespace std;

int main()
{
	int n;
	scanf("%d",&n);
	int n1=n;
	int n2=n/10;
	int n3=n/100*10+n%10;
	printf("%d\n",max(n1,max(n2,n3)));
}

#include <iostream>
#include<cstring>
using namespace std;

int main()
{
    string s;
    int c,s1,s2;
    cin >> s;
    c=s.size();
    if(s[0]!='-')

            cout << s<<endl;

    else
    {
        if(c==3&&s[c-2]>s[c-1]&&s[c-1]=='0'){
            cout << "0" <<endl;

            }
        else{
        for(int i =0;i<c;i++){
        if(s[c-1]-'0'>=s[c-2]-'0'&&i==c-1)
            continue;
        else if ((s[c-1]-'0')<(s[c-2]-'0')&&i==c-2)
            continue;
        else
            cout << s[i];
        }
        }
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    int k = s.size();
    int rem_ind = k-1;
    if(s[k-1]<s[k-2]){
        rem_ind = k-2;
    }
    if(s[0]!='-'){
        for(int i=0; i<k; i++){
            cout<<s[i];
        }
    }
    else{
        if((s[s.length()-1]=='0' || s[s.length()-2]=='0') && s.length()==3){
            cout<<0;
        }
        else {
            for (int i = 0; i < k; i++) {
                if (i != rem_ind)
                    cout<< s[i];
            }
        }
    }
    return 0;
}

#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;
typedef long long ll;
bool solve(){
	int n;
	scanf("%d", &n);
	if(n > 0) printf("%d\n", n);else{
		if(n / 10 < (n / 100) * 10 + n % 10) printf("%d\n", (n / 100) * 10 + n % 10);else printf("%d\n", n / 10);
	}
	return true;
}

int main(){
#ifndef ONLINE_JUDGE
	while(solve()){}
#else
	solve();
#endif
}

#include<iostream>

using namespace std;

int main(){
    int n;
    cin>>n;
    if(n>=0) cout<<n;
    else {
        int n1=n/10;
        int n2=(n/100)*10+n%10;
        if(n2>n1) cout<<n2;
        else cout<<n1;

    }
    return 0;

}

#include<iostream>
#include<string.h>
#include<set>
#include<map>
#include<stdio.h>
#include<math.h>
#include<queue>
#include<deque>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<time.h>
#include<vector>
#include<iomanip>
using namespace std;
#define ll long long
#define FLAG if(flag)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define mp make_pair
#define pb push_back
#define forn(a,b) for(int i=(a);i<=(b);++i)
#define fors(a,b) for(int i=(a);i<(b);++i)
const ll mod=1e9+7;
//ll qpow(ll n,ll k) {ll ans=1;while(k>0){if(k&1) ans=(ans*n)%mod;n=(n*n)%mod;k>>=1;}return ans;}
//ll INV(ll x){ return x==1?x:1LL*(mod-mod/x)*INV(mod%x)%mod; }
//ll gcd(ll a,ll b){if(a<b)swap(a,b);return a%b==0?b:gcd(b,a%b);}
const ll MAX=1e6+10;
int a[100005];
int main(){
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n,k,m,sum,t,len;
//freopen("Ain.txt","r",stdin);
//freopen("Aout.txt","w",stdout);
string s,d;
while(cin>>s){
int flag=1;
sum=0;
len=s.size();
if(s[0]!='-')cout<<s<<endl;
else {
        if(len==2)cout<<"0"<<endl;
        else if(len==3){
            if(s[1]=='0'||s[2]=='0')cout<<"0"<<endl;
            else {fors(0,len-2)cout<<s[i];
         if(s[len-2]>s[len-1])cout<<s[len-1]<<endl;
         else cout<<s[len-2]<<endl;}
        }
         else{fors(0,len-2)cout<<s[i];
         if(s[len-2]>s[len-1])cout<<s[len-1]<<endl;
         else cout<<s[len-2]<<endl;}
}
}
return 0;
}

#include <iostream>
int main()
{
	using namespace std;
	int n;
	cin >> n;
	int h1, h2;
	if(n<0)
	{
	h1 = n % 10;
	h2 = (n % 100) / 10;
	if (h1 <= h2)
		n = n / 10;
	else if (h1 >= h2)
	{
		int k = n % 10;
		int z = (n%100)/10;
		n = (n / 10)+k-z;
	}
	}
	cout << n;
}

#include<bits/stdc++.h>

#define x first
#define y second
#define pb push_back
#define inf 0x3f3f3f3f
#define mod 1000000007
#define sq(x) ((x)*(x))
#define bit(x, y) (((x)>>(y))&1)
#define bctz(x) (__builtin_ctz(x))
#define bclz(x) (__builtin_clz(x))
#define bclzl(x) (__builtin_clzl(x))
#define bctzl(x) (__builtin_ctzl(x))
#define bpt(x) (__builtin_popcount(x))
#define bptl(x) (__builtin_popcountll(x))
#define PQ priority_queue<pii, vector<pii>, greater<pii> >
#define eps 1e-8
#define squ(a, b) (a)*(a)+(b)*(b)
#define pi 3.1415926535897932384626433832795

using namespace std;

typedef double DO;
typedef long double LD;
typedef long long INT;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;
typedef vector<int> VI;

template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}

template <class T> inline void gn(T &x) {char c, sg=0; while(c=getchar(), (c>'9' || c<'0') && c!='-'); for((c=='-' ? sg=1, c=getchar() : 0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0'; if(sg) x=-x;}
template <class T1, class T2> inline void gn(T1 &x1, T2 &x2) {gn(x1), gn(x2);}
template <class T1, class T2, class T3> inline void gn(T1 &x1, T2 &x2, T3 &x3) {gn(x1, x2), gn(x3);}
template <class T1, class T2, class T3, class T4> inline void gn(T1 &x1, T2 &x2, T3 &x3, T4 &x4) {gn(x1, x2, x3), gn(x4);}
template <class T1, class T2, class T3, class T4, class T5> inline void gn(T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5) {gn(x1, x2, x3, x4), gn(x5);}

template <class T> inline void print(T x) {if(x<0) {putchar('-'); return print(-x);} if(x<10) {putchar('0'+x); return ;} print(x/10); putchar(x%10+'0');}
template <class T> inline void println(T x) {print(x); putchar('\n');}
template <class T> inline void printsp(T x) {print(x); putchar(' ');}
template <class T1, class T2> inline void print(T1 x1, T2 x2) {printsp(x1), println(x2);}
template <class T1, class T2, class T3> inline void print(T1 x1, T2 x2, T3 x3) {printsp(x1), printsp(x2), println(x3);}
template <class T1, class T2, class T3, class T4> inline void print(T1 x1, T2 x2, T3 x3, T4 x4) {printsp(x1), printsp(x2), printsp(x3), println(x4);}
template <class T1, class T2, class T3, class T4, class T5> inline void print(T1 x1, T2 x2, T3 x3, T4 x4, T5 x5) {printsp(x1), printsp(x2), printsp(x3), printsp(x4), println(x5);}

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}

int x, y;

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int n;
	gn(n);

	if(n>=0)		return println(n), 0;
	else	n=abs(n);

	x=n%10;
	y=(n%100)/10;

	int ans=min((n-x)/10, (n/100)*10+x);

	println(-ans);

	return 0;
}

#include<iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    if(n>=0)
	cout<<n<<endl;
    else
    {
        int a, b, c;
	a = n/10;
	b = n%10;
	c = n/100;
	c = c*10+b;

	if(a>c)
	    cout<<a<<endl;
	else
	    cout<<c<<endl;
    }
    return 0;
}

#include<iostream>
#include<fstream>
#include<cmath>
#include<cstdlib>
#include<cstring>
using namespace std;
/*//void xoakitu(char *xau,int v,int n=1)
{
    v+n-1>strlen(xau)?*xau=NULL:xau[v]=xau[v+n],v+n<strlen(xau)?xoakitu(xau,v+1,n):0;
} */
#define For(i,n) for(i=1;i<=n;i++)
int main()
{
    ifstream in("input.txt");
    int m,n,k,i,j;
    char a[400];
    cin>>a;
    n=strlen(a);
    if(a[0]=='-' )// -123
    {
        if(a[n-1]>= a[n-2] )
            a[n-1]='\0';
        else
        {
            a[n-2]=a[n-1];
            a[n-1]='\0';
        }
    }
    if(a[0]=='-' && a[1]=='0') { cout<<"0";  return 0;}
    cout<<a;

}

#include<iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    if(n>=0)
	cout<<n<<endl;
    else
    {
        int a, b, c;
	a = n/10;
	b = n%10;
	c = n/100;
	c = c*10+b;

	if(a>c)
	    cout<<a<<endl;
	else
	    cout<<c<<endl;
    }

}

#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	long long n,m;
	string out;
	cin >>n;

	if (n >= 0) { cout << n; return 0; }
	n = abs(n);
	int rem10 = n % 10;//last

	int rem100 = n % 100;
	int rem = (rem100 - rem10)/10;//next to last
	if (rem10 > rem) {
		n = n - rem10;
		n /= 10;
	}
	else {
		n = n - rem100;
		n /= 10;
		n += rem10;
	}

	cout << -1 * n;
}

#include <iostream>
#include <string>
#include <cmath>

using namespace std;
int main ()
{
   int n;
   cin>>n;
   if (n>=0)
   cout<<n;
   else {
    int n1=n/10;
    int n2=(n/100)*10+n%10;
     if (n1>n2)
     cout<<n1;
     else
     cout<<n2;
   }
  return 0;
}

// 313A.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include<math.h>
using namespace std;
int main()
{
	long long int n;
	cin >> n;
//	cout << abs(n % 100) / 10<<" "<<abs(n%10);
	if (n < 0)
	{
		if (abs(n % 10) > abs(n % 100)/10)
			cout << ((n / 100)*10)+((n%100)/10);
		else
			cout << (n / 100)*10+(n%10);
	}
	else
	cout << n;

	return 0;
}

#include<iostream>
using namespace std;
int numOfDigits(int num){
	int digit = 0;
	num *= -1;
	while (num > 0){
		num = num / 10;
		digit++;
	}
	return digit;
}
void toArr(int num, int * a){
	num *= -1;
	int i = 0;
	while (num > 0){
		a[i] = num % 10;
		num /= 10;
		i++;
	}
}
void main(){
	int digit = 0 ,index  ,c=0;
	long long num;
	cin >> num;
	if (num >= 0){
		cout << num;
	}
	else{
		digit = numOfDigits(num);
		int * a = new int[digit];
		toArr(num, a);
		if (a[0] > a[1]){
			index = 0;
		}
		else{
			index = 1;
		}
		for (int i = digit; i > 0; i--){

			if (i - 1 != index){
				if (c == 0){
					cout << -1 * a[i - 1]; c++;
				}
				else
				cout <<  a[i - 1];
			}

		}
	}
}

// Example program
#include <iostream>
#include <string>
#include<iomanip>
#include<cmath>
void str(long long n);
using namespace std ;
int main(){
long long n;
cin>>n;
str(n);
return 0;}
void str(long long n){
  if(n>=0)
  cout<<n;
  else if(n<0){

     if(n/10>=(n/100*10+n%10))
      cout<<n/10;
      else
      cout<<n/100*10+n%10;

  }

}

#include<cstdio>
#include<cstdlib>
int main () {
	int n;
	scanf("%d",&n);
	if(n>0) printf("%d",n);
	else {
		if(n/10>n/100*10+n%10)
		printf("%d",n/10);
		else
			printf("%d",n/100*10+n%10);
		}
	return 0;
}

#include<iostream>
#include<string>
#include<sstream>
#include<cmath>
using namespace std;
void m(int &x ){
	int l  ;
	l = x % 10;
	x = (x / 10) / 10;
	x = x * 10 + l;
}
void main(){
	int x;
	cin >> x;

	if (x>0){
		cout << x;
		return;
	}

	if (abs(x%10) >= abs((x/10)%10)){
		cout << x / 10; return;
	}
	else{
		m(x);
		cout << x;
	}

}

#include <iostream>
#include <math.h>
#include <array>
using namespace std;
int main(){
     int n;
     cin>>n;
     cout<<max(max(n/100*10+n%10,n/10),n);

    return 0;
}

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>

using namespace std;
int num, num_arr[10], size_n;
int main()
{
    cin >> num;
    if (num >= 0)
    {
        cout << num << endl;
        return 0;
    }
    else
    {
        num = -1 * num;
        int d1 = num % 10;
        int d2 = (num / 10) % 10;
        int fixed = num / 100;

        fixed = fixed * 10 + (d1 < d2 ? d1 : d2);
        // if (d1 < d2)
        // {
        //     fixed = fixed * 10 + d1;
        // }
        // else
        // {
        //     fixed = fixed * 10 + d2;
        // }
        fixed *= -1;
        cout << fixed << "\n";
    }
}

#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include<iomanip>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    if(n >= 10) cout << n;
    else
    {
        int a = n / 10;
        int b = (n / 100 + 1 - 1) * 10 + n % 10;
        cout << max(max(a, b), n);
    }
}

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin>>n;
    if (n<0){
        if (n>-10) n=0;else{
                n=-n;
                int value1= n/10;
                int value2= (value1/10)*10+ n %10;
                value1=-value1;
                value2= -value2;
                n= max(value1,value2);
        }
    }
    cout<<n<<endl;
    return 0;
}

#include<iostream>
#include<string>
#include<algorithm>
typedef long long int ll;
using namespace std;
void main()
{
    int n;
    cin >> n;
    int x = n;
    string s;   int c = 0;
    if (n > 0)
        cout << n << endl;

    else
    {
        n *= -1;
        x *= -1;
         s=to_string((-n / 100)) + to_string(min(x % 10, ((x % 100) / 10)));
         for (int i = 0; i < s.length(); i++)
         {
             if (s[i] != '0')
             {
                 c = 1;
                 break;
             }
         }
         if (c == 1)
         {

             if (n / 100 == 0)
                 cout << to_string(-min(x % 10, ((x % 100) / 10)));
             else
                 cout << s;
         }
         else
             cout << 0;
    }
}

#include <iostream>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <algorithm>
#include <cmath>

typedef long long ll;

using namespace std;

int main() {
	ll n = 0;
	cin >> n;
	ll a = n / 10;
	ll b = n % 10 + (n / 100) * 10;
	if (n < 0) {
		if (abs(n % 10) >= abs(n / 10 % 10)) {
			cout << a;
		}
		else {
			cout << b;
		}
	}
	else {
		cout << n;
	}
}

#include<iostream>
using namespace std;
int main ()
{
  int n;
  cin>>n;
  if (n>=0)
  cout<<n<<endl;
  else
  {
    int n1,n2;
    n1=n/10;
    n2=(n/100)*10 +n%10;
    if (n1>n2) cout<<n1;
    else
    cout<<n2;
  }

}

#include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main(){
    int n;
    cin>>n;
    if(n>0){
        cout<<n;
        exit(0);
    }
    else if(n%10 == 0 && n < 100 && n > -100){
            cout<<"0";
        }
    else{
       if(abs(n%10)>=abs((n%100)/10) )
       cout<<n/10;
       else{
           if(n/100 == 0){
              cout<<n%10;
           }

           else
         cout<<(n/100)<<(abs(n%10));
        }
    }
    }

#include<iostream>
using namespace std;
int main()
{
  int n,t,b;
  cin>>n;
  if(n>0)
  cout<<n;
  else if(n<0)
  {
    b=n/10;
    t=n/100*10+n%10;
    if(b>t)
    cout<<b;
    else
    cout<<t;
  }
  return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int x,r,z,d,y;
	cin >> x;
	if (x > 0) {
		cout << x << endl;
	}
	else {
		for (int i = 0;i < 1;i++) {
			r = x % 10;
			x = x / 10;
			z = x;
		}
		for (int i = 0;i < 1;i++) {
			d = x % 10;
			x = x / 10;
			y = x;
			y = y * 10 + r;
		}
		if (z > y)
			cout << z << endl;
		else
			cout << y << endl;
	}
}

#include <iostream>
#include <algorithm>
using namespace std;
int n,a,b,ans;
main(){
 cin>>n;
 if (n>=0) ans=n;
 else{
  n=-n;
  a=n/10;
  b=(n/100)*10+n%10;
  ans=-min(a,b);
 }

 cout<<ans<<endl;

}

#include<iostream>
#include<string>
using namespace std;
int main() {
	/*int x,y;
	cin >> x>>y;
	if (x<y)
		if(x!=1&&y!=1&&x%2==0)
		cout << "Malvika" << endl;
		else
		cout << "Akshat" << endl;
	else
		if(x!=1&&y!=1&&y%2==0)
			cout << "Malvika" << endl;
		else
			cout << "Akshat" << endl;*/
			/*string x;
			string y;
			getline(cin, x);
			int c = 0;

			for (int i = 0; i < x.size(); i++) {
				if (x[i] != 'W' || x[i + 1] != 'U' || x[i + 2] != 'B')
					c++;

				if (x[i] == 'W' && x[i + 1] == 'U' && x[i + 2] == 'B') {

					if ((i != 0 || i != x.size() - 3)&&c!=0)

						y += " ";
					i += 2;
				}

				else
					y += x[i];
			}
			cout << y << endl;*/

	int x;
	cin >> x;
	if (x >= 0)
		cout << x;
	else {
		int z = x / 10;
		int c = x / 100;
		c = c * 10 + (x % 10);
		if (c > z)
			cout << c << endl;
		else
			cout << z << endl;

	}
}

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	cin>>n;
	cout<<max(n,max(((n/100)*10+n%10),n/10))<<endl;
	return 0;
}

#include <iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    if (n>=0)
    cout<<n;
    else {
        int a=n/10;
        int b=(n/100)*10+n%10;
        if (a>b)
        cout<<a<<endl;
        else cout<<b<<endl;
    }
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int n,num1,num2,n1;
    cin>>n;
    n1=n;
    if(n>=0)
    cout<<n;
    else
    {
        num1=n/10;
        //n=n*10;
        n1=n1%10;
        //cout<<n1<<" ";
        //cout<<n<<" ";
        n=n/100;
        //cout<<n<<" ";
        num2=n*10 + n1;
        if(num1>num2)
        cout<<num1;
        else
        cout<<num2;
    }
}

#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <functional>
#include <iterator>
#include <locale>
#include <cctype>

using namespace std;

void main() {
    string n;
    cin >> n;
    string x = n, y = n, output;
    if (stoi(n) > 0) {
        cout << n;
    }
    else {
        y.erase(n.length() - 2, 1);
        x.erase(n.length() - 1, 1);
        if (stoi(x) > stoi(y)) {
            output = x;
        }
        else {
            output = y;
        }
    }

    if (output == "-0") {
        output = "0";
    }

    cout << output;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
	long long n = 0, del1 = 0, del2 = 0;
	cin >> n;
	if (n > 0) {
		cout << n;
		return 0;
	}
	del1 = n / 10;
	del2 = (n / 100) * 10 + n % 10;

	if (del1 > del2)cout << del1;
	else cout << del2;
	return 0;
}

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int n,b,c,m;
	cin >> n;
	if (n>=0)
		cout << n;
	else
	{
		b = n / 10;
		m = n % 10;
		c = ((n / 100) * 10) + m;

		cout << max(b, c);

	}

	return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int n,n1,m1,S;
    cin>>n;
    if(n<0)
   { n1=n/10;
   S=n%10;
    m1=n1/10;
    m1=m1*10;
    m1=m1+S;
    if(n1>m1)
        cout<<n1<<endl;
        else
            cout<<m1<<endl;}
            else
            cout<<n;
    return 0;

}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {return (b ? gcd(b, a % b) : a);}
#define print(n) cout<<n<<"\n"
#define next "\n"

void io() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}

void ogla()
{
    signed long n;
    cin >> n;
    // print(n % 100);
    if (n >= 0) print(n);
    else if(n/100==0) {
        signed long firstDigit = n % 10;
        signed long second = n / 10;
        print(max(firstDigit , second));
    }
    else {
        signed long firstDigit = n % 10;
        signed long ans = max(n / 10, (n / 100 * 10) + firstDigit);
        // print(n / 10 + firstDigit);
        // cout << "n: " << n << " first: " << firstDigit << " ans: " << ans;
        print(ans);
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    io();
    ogla();
    return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main(){int a;cin>>a;
if(a>=0)cout<<a;
else if(-a/10<10&&a%10==0)cout<<"0";
else {
string s=to_string(a);

    int n=s.length();
    if(s[n-1]>=s[n-2]){for(int i=0;i<n-1;i++)cout<<s[i];}
    else {for(int i=0;i<n;i++)if(i!=n-2)cout<<s[i];}
    }

}

#include <iostream>
using namespace std;
int main() {

    int n;
    cin>>n;
    if(n>=0)
    cout<<n;
    else
    {
        int n1,n2;
        cin>>n1>>n2;
     n1=n/10;
      n2=n/100*10+n%10;
      if(n1>n2)
      cout<<n1;
      else
      cout<<n2;

    }
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include <algorithm>
using namespace std;
char s[100];
int main()
{
    while(scanf("%s",s)!=EOF)
    {
        int len=strlen(s);
        char *p;
        char x=s[len-1],y=s[len-2];
        if(s[0]>='0')
            printf("%s\n",s);
        else
        {
            if(x<y)
            {
                s[len-2]=s[len-1];
                s[len-1]=0;
            }
            else
                s[len-1]=0;
            p=&s[1];
            while(*(p)=='0')
            {
                *p='-';
                p++;
            }
            if(*p)
                printf("%s\n",p-1);
            else
                printf("0\n");
        }
    }
    return 0;
}

#include <iostream>
using namespace std;

int main() {
	int x,p,q;
	cin>>x;
	if(x>=0)
	cout<<x;
	else {
		q=x/10;
		p=x/100*10+x%10;
		if(q>=p)
		cout<<q;
		else if(p>q)
		cout<<p;
	}
	return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
cin>>n;

if (n>0)
cout<<n<<endl;
else if (n/10 > (n/100)*10+n%10)
cout<<n/10<<endl;
else
cout<<(n/100)*10+n%10<<endl;

return 0;
}

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#define sp system("pause");
using namespace std;
void main() {
	string t;
	cin >> t;
	if (t[0] != '-')cout << t;
	else {
		int a = t[t.length() - 1] - 48, b = t[t.length() - 2] - 48;
		if (a > b)t.erase(t.length() - 1, 1);
		else t.erase(t.length() - 2, 1);

		if (t.length() == 2 && t[1] == '0')
			cout << 0;
		else
			cout << t;
	}

}

#include <bits/stdc++.h>

// Typedef
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;

#define sf                  scanf
#define sn(n)               sf("%d",&n)
#define sn2(a,b)            sf("%d%d",&a,&b)
#define sn3(a,b,c)          sf("%d%d%d",&a,&b,&c)
#define sn4(a,b,c,d)        sf("%d%d%d%d",&a,&b,&c,&d)
#define sl(n)               sf("%lld",&n)
#define sl2(a,b)            sf("%lld%lld",&a,&b)
#define sl3(a,b,c)          sf("%lld%lld%lld",&a,&b,&c)
#define sl4(a,b,c,d)        sf("%lld%lld%lld%lld",&a,&b,&c,&d)
#define pf                  printf
#define pb                  push_back
#define FOR(i, a, b)        for(int i = a; i<b; i++)
#define For(i, a, b)        for(int i = a; i<=b; i++)
#define min3(a, b, c)       min(a, min(b, c))
#define max3(a, b, c)       max(a, max(b, c))
#define MEM(a, x)           memset(a, x, sizeof(a))
#define Binary(x,b)         std::bitset< b >( x ).to_string()
#define rev(s)              reverse(s.begin(), s.end())
#define line(s)             getline(cin, s)
#define shift(s,pos,len)    s.substr(pos,len)
#define PI                  (2.0*acos(0.0))  // 3.1415926535897932
#define Read                freopen("in.txt", "r", stdin)
#define Write               freopen("out.txt", "w", stdout)

// Debug
#define out(x)              cout << #x << " = " << x << endl
#define out2(a,b)           cout<<a<<" "<<b<<endl
#define out3(a,b,c)         cout<<a<<" "<<b<<" "<<c<<endl
#define out4(a,b,c,d)       cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl
#define out5(a,b,c,d,e)     cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl

using namespace std;

int main()
{
    //freopen("in.txt", "r", stdin);
    string s;
    cin>>s;
    if(s[0]=='-') (((s[s.size()-1]) > (s[s.size()-2])) ? (s.erase(s.size()-1)) : (s.erase(s.size()-2,1)));
    ((s[0]=='-') && (s[1]=='0')) ? cout<<"0" : cout<<s;
    return 0;
}

#include <iostream>
using namespace std;

int main ()
{
        int n;
        cin>>n;

        if (n>=0)
        cout<<n;
        else
        {
                int n1=n/10;//if the last num is bigger .
                int n2=n/100*10+n%10;//if the last num is smaller.
               if (n1<n2)
               cout<<n2;
               else
               cout<<n1;

        }
        return 0;

}

#include<iostream>
using namespace std;
int main()
{
    int n;
    int first,second;
    cin>>n;

    if(n>=-10)
    {
        cout<<max(0,n);
    }
    else
    {
       first=(-n)/10;
       second=((-n)/10)-(((-n)/10)%10)+(-n)%10;
       cout<<max(-first,-second);
    }
}

#include <bits/stdc++.h>
using namespace std;
int xizosolution(int n){
  if (n>=0) return n;
  else return max(n/10,((n-n%10)/100)*10+n%10);
}
int main(){
  int n;
  cin>>n;
  cout<<xizosolution(n);
}

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    if (n >= 0)
    {
        cout << n << endl;
    }
    else
    {
        int a = n / 10;
        int b = n / 100 * 10 + n % 10;
        cout << max(a, b) << endl;
    }
    return 0;
}

#include <iostream>
#include <iomanip>
#include <string>
#include <cstring>
#include <sstream>
#include <utility>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>

#define f first
#define s second
#define mp make_pair
#define pb push_back

using namespace std;

int main()
{
    string num;
    cin >> num;

    if (num[0] != '-')
    {
        cout << num << endl;
        return 0;
    }

    if (num.size() == 3 && num[2] == '0')
    {
        cout << 0 << endl;
        return 0;
    }

    int res = -9999999999;

    for (int i = num.size() - 2; i < num.size(); i++)
    {
        string curNum = num;
        curNum.erase(curNum.begin() + i);

        if (curNum[1] == '0')
        {
            continue;
        }

        res = max(atoi(curNum.c_str()), res);
    }

    cout << res << endl;

    return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
main(){int k; cin >> k; cout << max(k, max(k/10, k/100*10+k%10)) << endl;
}

#include<iostream>
#include<string>

using namespace std;

string str;
long long int n;

int main() {

    cin >> str;

    n = str.length();

    if(str[0] != '-')
    {
        cout << str;
    }
    else if(str[0] == '-')
    {
        if(str[n - 1] < str[n - 2])
        {
            //str.erase(0,1);

            str.erase(n - 2 , 1);
            n--;
            if(str[n - 1] == '0' & n == 2)
            {
                str.erase(0,1);
            }

        }
        else
        {
            str.erase(n-1,1);

        }

        cout << str;
    }

    return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
	int i=0,l,n,f,k,m,p,t;
	scanf("%d",&n);
	if(n>=0)
	printf("%d",n);
	else
	{
		f=n/100;
		p=n%100;
		l=abs(n);
		m=(l%10);
		k=l/10;
		t=k%10;
		 if(m<t && f==0 && p != 0)
		printf("%d",-m);
		else if(m>t && f==0 && p!=0)
		printf("%d",-t);
		else if(m>=t && f==0)
		printf("%d",-t);
		else if(m<t && f==0)
		printf("%d",-m);
		else if(m>t)
		printf("%d%d",f,t);
		else
		printf("%d%d",f,m);

	}

return 0;
}

#include <bits/stdc++.h>

using namespace std;
int main()
{
int x,q,z;
cin>>x;
if(x<0)
{
q=x%10;
z=(x/10)%10;

if(q<=z)
    cout<<x/10;
else if (q>z&&q==x/100)
    cout<<(x/100);
else
{if(x/100==0)
   cout<<q;

else{
      q*=-1;
       cout<<(x/100)<<q;
}

}

}
else
    cout<<x;
}

#include<iostream>
#include <sstream>
using namespace std;
int convert(string s)
{
    stringstream geek(s);
    int x = 0;
    geek >> x;
    return x;
}
string test2(string s){
    string temp;
for(int i=0;i<s.size();i++){
    if(i!=s.size()-2){
        temp+=s[i];
    }

}
return temp;

}
string test1(string s){
    string temp;
for(int i=0;i<s.size();i++){
    if(i!=s.size()-1){
        temp+=s[i];
    }
}
return temp;
}
string num1,temp1,temp2;
int num2,num3,temp3;
int main(){
    cin>>num1;
    temp3=convert(num1);
    if(temp3>0){
        cout<<num1;
    }
    else{
    temp1=test1(num1);
    temp2=test2(num1);
    num2=convert(temp1);
    num3=convert(temp2);
if(num2>num3){
    cout<<num2;
}
else{
    cout<<num3;
}
    }
return 0;
    }

#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <vector>
#include <stack>
#include <array>
#include <list>
#include <queue>
#include <utility>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <bitset>
#include <sstream>
#include <tuple>
#include <cstdint>
#include <memory>

using namespace std;

typedef unsigned int uint;
typedef unsigned long long int llu;

#define rep(n) for(int i = 0; i < (n); i++)
#define all(c) c.begin(), c.end()
#define pb push_back

inline string balance(const string& value) {
	if (value == "-0") return "0";
	return value;
}

int main()
{
	string value;
	cin >> value;
	if (value[0] != '-') {
		cout << balance(value);
	} else {
		if (value.length() == 2) {
			cout << 0;
			return 0;
		} else {
			int len = value.length();
			if (value[len - 1] > value[len - 2])
				cout << balance(value.substr(0, len - 1));
			else
				cout << balance(value.substr(0, len - 2) + value[len - 1]);
		}
	}
}

#include<iostream>
using namespace std;
int main ()
{
    int n;
    cin>>n;
    if (n>0)
    cout<<n;

    else
    {
        int n1 ,n2 ;
        n1 = n /10;
        n2 = (n/100)*10+(n%10);
        if (n1 > n2)
        cout<<n1 ;
         else
         cout<<n2;
    }
    return 0;
}

#include<iostream>
using namespace std;
int dic(long x)
{
    int k=0;
    while (x!=0)
    {
        x=x/10;
        k++;

    }
    return k;
}
int main()

{
    long n;
    cin>>n;
    long s=n*(-1);
    long st=s/10;
    long temp=n/10;

   if(n<0)
   {
       if(dic(s)==2)
            {
                if(s%10<st%10) cout<<n%10<<endl;
                else cout<<temp%10<<endl;
                return 0;
            }
        if(temp%10==0&&n%10==0) cout<<n/10<<endl;
        else if(temp%10!=0&&n%10!=0)
        {

            if(n%10>temp%10) cout<<n/100<<s%10<<endl;

            else cout<<n/10<<endl;

        }
       else if(temp%10==0&&n%10!=0) cout<<n/10<<endl;
        else
        {

            if(n/100==0) cout<<n/100<<endl;
            else cout<<n/100<<"0"<<endl;
        }

    }
    else cout<<n<<endl;

}

#include<stdio.h>
#include<string>
int main()
{
char s[17];
scanf("%s",&s);
if(s[0]!='-')
{printf("%s",s); return 0;}
if(s[strlen(s)-2]=='-')
{printf("%c",s[1]); return 0;}
else if(s[strlen(s)-1]>=s[strlen(s)-2])
s[strlen(s)-1]='\0';
else
{s[strlen(s)-2]=s[strlen(s)-1];
s[strlen(s)-1]='\0';}
if(s[1]=='0')
printf("0");
else
printf("%s",s);
return 0;
}

/*
	Author : Amar Prakash Pandey
	contact : http://amarpandey.me
*/
#include <string.h>
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <ctime>
#include <assert.h>
#define pi 3.14159
#define mod 1000000007
int a[20] = {0},b[20] = {0};
using namespace std;
int main()
{
  long long int n, i=-1, j=0;
  int fixed=0,limit=0; cin>>n;
  if(n >= 0) {cout<<n;}
  else if(n == -10) {cout<<"0";}
  else {
    n = abs(n);
    fixed = n;
    while (n>0) {
      i += 1;
      a[i] = n%10;
      b[i] = a[i];
      n = n/10;
    }
    fixed = i;
    j = fixed;
    sort(a+0,a+i+1);
    for(i=j;i>=0;i--) {if(b[i] == a[fixed]){b[i] = -1;break;}}
    cout<<"-";
    for(i=0;i<=fixed;i++) {
      if(b[i]>0)
        {cout<<b[i];}
    }
  }
	return 0;
}

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <bitset>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <cstdio>
#include <memory.h>
#include <time.h>
using namespace std;

typedef long double ld;
typedef long long li;

#define check_coor(x, y) ((x) < m && (x) >= 0 && (y) < n && (y) >= 0)
#define sqr(a) ((a) * (a))
#define abs(a) ((a) < 1e-9 ? -(a) : (a))
const int MAXN = 1e8 + 7;
const int MOD = 98759873;
const int INF = 1e9 + 7;
const long long LINF = (long long) 1 << 62;
const double DINF = 1e20 + 7;
const double EPS = 1e-9L;
const double PI = acos(-1.0L);
const double E = 2.718281828459045235L;
const int dx4[] = {1, 0, -1, 0};
const int dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int hdx[] = {2, 1, -1, -2, -2, -1, 1, 2};
const int hdy[] = {1, 2, 2, 1, -1, -2, -2, -1};
const int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const string way4[] = {"R", "D", "L", "U"};
const string way8[] = {"E", "SE", "S", "SW", "W", "NW", "N", "NE"};
const char* move[] = {"RIGHT", "DOWN", "LEFT", "UP"};

void solve()
{
	int a;
	cin >> a;

	if (a >= 0)
		cout << a << endl;
	else
	{
		int l = abs((a % 100) / 10);
		int r = abs(a % 10);

		if (l > r)
			cout << (a / 100) * 100 + (a % 10) << endl;
		else
			cout << a / 10 << endl;
	}
}

int main()
{
	#ifdef bullshit
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#endif

	cin.sync_with_stdio(0);

	solve();

	return 0;
}

#include <iostream>
#include <string>
using namespace std;
int  main(){
	string s;
	cin >> s;
	if (s[0] != '-')
		cout << s << endl;
	else
	for (int i = 0; i < s.length(); i++)
	{
		cout << s[i];
		if (i == s.length() - 3)
		{
			if (s[s.length() - 2]>s[s.length() - 1])
			{
				cout << s[s.length() - 1] << s[s.length()] << endl;
				break;
			}
			if (s[s.length() - 2] < s[s.length() - 1])
			{
				cout << s[s.length() - 2] << s[s.length()] << endl;
				break;
			}
		}

	}
	return 0;
}

#include <iostream>
using namespace std ;

int main(){
	long long n ;
	cin >> n ;
	if(n<0){
		int primer_digito = n%10 ;
		int segundo_digito = (n/10)%10 ;
		if( primer_digito==0 && segundo_digito==0){
			cout << n ;
			}
		if(primer_digito<segundo_digito){
			n = n/10 ;
			cout << n ;
		}
		else{
			n = n/100 ;
			n = n*10 + primer_digito ;
			cout << n ;
		}
	}
	return 0;
}

#include <iostream>
#include <sstream>
#include <string>

int max=-9999999;
std::string maxS = "";
void subS(std::string input, int skip) {
	std::string hasil = input.erase(skip, 1);
	int pembagi = 0, c=hasil.length()-1,res;
	while(hasil[c]==48){
		c--;
		pembagi++;
	}
	std::string angka = hasil.substr(0, hasil.length()-pembagi);
	std::stringstream stream(angka);
	stream >> res;
	res*=-1;
	if(res>max) {
		max = res;
		maxS = (res!=0)?"-"+hasil:hasil;
	}
}

void findMaxValue(std::string input) {
	std::string pos = input.substr(1,input.length()-1);
	for(int i=0;i<pos.length();i++)
		subS(pos,i);
}

int main() {
	int res;
	std::string input;
	std::cin >> input;
	std::stringstream stream(input);
	stream >> res;
	if(res < 0){
		findMaxValue(input);
		std::cout << maxS;
	} else {
		std::cout << input;
	}
	return 0;
}

#include <iostream>

using namespace std;

int main (){

    int n;

    cin>>n;

    if (n>=0){
        cout << n;
    }else if(n%10==0){
        cout<<n%10;

    }else{
        cout << (n-n%10)/10;
    }

    return 0;
}

#include<iostream>
#include<vector>
#include<string.h>
#include<algorithm>
#include<cstdio>
using namespace std;
int main()
{
	char str[100002], a[100002], b[100002];
	cin >> str;
	int r = atoi(str);
	if (r >= 0)
		cout << r << endl;
	else if (r == -10)
		cout << 0 << endl;
	else
	{
		int j = 0;
		char s = strlen(str);
		for (int i = 0; i < s; i++)
		{
			if (str[i] != str[s - 1])
				a[i] = str[i];
		}
		for (int i = 0; i < s; i++)
		{
			if (str[i] != str[s - 2])
				b[i] = str[i];
		}
		int m = atoi(a);
		int w = atoi(b);
		int d = min(-m, -w);
			cout << '-' << d << endl;
	}
	//system("pause");
	return 0;

}

#include <iostream>
using namespace std;
int main() {
  int a;
  cin>>a;
  if (a>0) cout <<a;
  else {
    if(a<0)
    a=a%10;
    a=(a/100)*10+a%10;
    cout << a;

  }
  return 0;

}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,y;
    cin>>n;
    if(n>0)
      cout<<n;
    else
    {
       n=-n;
       x=n/10;
       y=n%10;
       if(x<y)
        cout<<x;
       else
        cout<<y;
    }
}

#include <iostream>
#include <string>
using namespace std;
int main(){
    string n;
    cin>>n;
    long m =atoi(n.c_str());
    if(m>=0) {cout<<n<<endl; return 0;}
    int s=n.size()-1;
    if(n[s]>n[s-1]) n.erase(s,1);
    else n.erase((s-1),1);
    cout<<n<<endl;
    return 0;
}

#include<iostream>
#include<string>
#include<algorithm>

using namespace std;
int main()
{
    int  x, y;
    cin >> x;
    if (x > 0){
        cout << x << endl;
    }
    else if (x == -10){
        x = 0;
        cout << x << endl;
    }
    else {
        x /= 10;
        cout << x << endl;
    }
        return 0;
    }

#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    //string x;
    vector <lli> c;
    lli a,d;
    cin>>a;
    //x=to_string(a);
    if(a>0)
        cout<<a;
    else
    {
        a=-a;
        while(a>0)
        {
           d=a%10;
           a/=10;
           c.push_back(d);
        }
        a=0;
        c.erase(find(c.begin(),c.end(),*max_element(c.begin(),c.end())));
        for(auto it = c.end()-1;it!=c.begin()-1;--it)
        {
            a=a*10+*it;
        }
        cout<<-a;
    }
    return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main ()
{
long long n,a[1000],count=0;
cin>>n;
int x=n,z=n;
int k=0;
if (n>0)
    cout<<n;
else
{
while (x!=0)
{
    count++;
    x=x/10;
}

for (int k=count-1;k>=0;k--)
{
a[k]=z%10;
z=z/10;
}
if (count==2)
    cout<<-a[count-1];
else if ((n<0)&&(a[count-1]<=a[count-2]))
    for (int i=0;i<count-1;i++)
        if (i==0)
        cout<<a[i];
        else cout<<-a[i];
else if ((n<0)&&(a[count-1]>a[count-2]))
    for (int i=0;i<count;i++)
        if ((i!=count-2)&&(i==0))
            cout<<a[i];
        else if ((i!=count-2)&&(i!=0))
            cout<<-a[i];
}

return 0;
}

#include<bits/stdc++.h>

#define x first
#define y second
#define pb push_back
#define inf 0x3f3f3f3f
#define mod 1000000007
#define sq(x) ((x)*(x))
#define bit(x, y) (((x)>>(y))&1)
#define bctz(x) (__builtin_ctz(x))
#define bclz(x) (__builtin_clz(x))
#define bclzl(x) (__builtin_clzl(x))
#define bctzl(x) (__builtin_ctzl(x))
#define bpt(x) (__builtin_popcount(x))
#define bptl(x) (__builtin_popcountll(x))
#define PQ priority_queue<pii, vector<pii>, greater<pii> >
#define eps 1e-8
#define squ(a, b) (a)*(a)+(b)*(b)
#define pi 3.1415926535897932384626433832795

using namespace std;

typedef double DO;
typedef long double LD;
typedef long long INT;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;
typedef vector<int> VI;

template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}

template <class T> inline void gn(T &x) {char c, sg=0; while(c=getchar(), (c>'9' || c<'0') && c!='-'); for((c=='-' ? sg=1, c=getchar() : 0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0'; if(sg) x=-x;}
template <class T1, class T2> inline void gn(T1 &x1, T2 &x2) {gn(x1), gn(x2);}
template <class T1, class T2, class T3> inline void gn(T1 &x1, T2 &x2, T3 &x3) {gn(x1, x2), gn(x3);}
template <class T1, class T2, class T3, class T4> inline void gn(T1 &x1, T2 &x2, T3 &x3, T4 &x4) {gn(x1, x2, x3), gn(x4);}
template <class T1, class T2, class T3, class T4, class T5> inline void gn(T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5) {gn(x1, x2, x3, x4), gn(x5);}

template <class T> inline void print(T x) {if(x<0) {putchar('-'); return print(-x);} if(x<10) {putchar('0'+x); return ;} print(x/10); putchar(x%10+'0');}
template <class T> inline void println(T x) {print(x); putchar('\n');}
template <class T> inline void printsp(T x) {print(x); putchar(' ');}
template <class T1, class T2> inline void print(T1 x1, T2 x2) {printsp(x1), println(x2);}
template <class T1, class T2, class T3> inline void print(T1 x1, T2 x2, T3 x3) {printsp(x1), printsp(x2), println(x3);}
template <class T1, class T2, class T3, class T4> inline void print(T1 x1, T2 x2, T3 x3, T4 x4) {printsp(x1), printsp(x2), printsp(x3), println(x4);}
template <class T1, class T2, class T3, class T4, class T5> inline void print(T1 x1, T2 x2, T3 x3, T4 x4, T5 x5) {printsp(x1), printsp(x2), printsp(x3), printsp(x4), println(x5);}

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}

int x, y;

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int n;
	gn(n);

	if(n>=0)		return println(n), 0;
	else	n=abs(n);

	x=n%10;
	y=(n%100)/10;

	int ans=min(n-x, n-10*y);

	println(-ans);

	return 0;
}

#include<iostream>
using namespace std;

int main()
{
    int n;
    cin>>n;
    if(n>=0)
    {
        cout<< n;
        return 0;
    }
    else
    {
        int hold=n;
        int f=10-hold%10;
        hold=hold/10;
        int s=10-hold%10;
        if(f>=s)
        n=n/10;
        else
        {
            n=(n/100);
            n=n*10 -f;
        }
        cout<< n;
    }
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    unsigned int a=n%10;
    unsigned int b=(n/10)%10;
    if(n<0){
        if(a>b){
            n=n/10;
        }
        else{
            n=(n/100)+a;
        }
        cout<<n;
    }

    else{
        cout<<n;
    }
}

#include<bits/stdc++.h>
using namespace std ;
int main()
{
   long long int n,tn;
   cin>>n;
   if(n>=0)
   cout<<n<<endl;
   else
   {
       vector <int> v;
       tn=abs(n);
       while(tn!=0)
       {
           int last=tn%10;
           v.push_back(last);
           tn=tn/10;

       }
       if(v[0]==0)
       v.pop_back();
       else
       {
           v.erase(v.begin());
       }
        bool a=0;
    for(int i=0;i<v.size();i++)
    {
        if(v[i]==0)
        continue;
        else
        {
            a=1;
        }

    }
    reverse(v.begin(),v.end());
    if(a)
    {
        cout<<'-';
        for(auto x:v)
        cout<<x;
        cout<<endl;
    }
    else
    {
        cout<<0<<endl;

    }

   }

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n;
    int f2,f1;
    cin>>n;
    if(n>0)
    cout<<n;
    else
    {
        f1=n/10;
        f2=n/100;
        if(f1>f2)
    cout<<f1;
    else
    cout<<f2<<(n%10);
    }

    return 0;
}

#include<iostream>
#include<cmath>
using namespace std;
int main () {
   int n,n1;
   cin>>n>>n1;
   if(n>0)
   cout<<n;
   else if(n<0)
   {  n=n/10;
   n1=n*10+(n%10);
    if(n>n1)
 cout<<n;
 else
 cout<<n1;}

 return 0;
}

#include <iostream>

using namespace std;
int m,k,val(string);
string s,t;
int main()
{
    cin>>s;
    if(s[0]!='-')
    {
        cout<<s;
        return 0;
    }
    s.erase(0,1);
    m=val(s);
    for(k=0;k<s.size();k++)
    {
        t=s;
        t.erase(k,1);
        m=min(m,val(t));
    }
    cout<<-m;
    return 0;
}
int val(string s)
{
    if(s[0]=='0')
        return 1000000000;
    int val=0;
    for(int i=0;i<s.size();i++)
        val=10*val+s[i]-'0';
    return val;
}

#include <iostream>

using namespace std;

int main()
{

    int a;
    cin>>a;
    if(a>=0)
    cout<<a<<endl;
    else
    if(a%10 > (a%100)-(a%10))
    std::cout << a/100+a%10 << std::endl;
    else
    cout<<a/10<<endl;

    return 0;
}

#include<iostream>

using namespace std;

int main(){
    int a ;
    cin>>a;
   int w=a%10;
    if (a<0){

        if (w==0){
            cout<<w<<'\n';
       int q=a/10;
       int w=a%100;
       int e=w/10;
       int t=q*10+e;
        if (t>q)
       cout<<t<<'\n';
       else
       cout<<q<<'\n';

        }
    }
    else

         cout<<a<<'\n';

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,maxi;
    string s;
    scanf("%d",&n);
    if(n>=0)printf("%d\n",n);
    else{
        maxi=n;
        if((n/10)>maxi)maxi=n/10;
        else if(((n%10)+(n/100)*10)>maxi)maxi=(n%10)+(n/100)*10;
        cout<<maxi<<endl;
    }
    return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
	long long x[102], b[102], j = 2, j1 = 1, f = 0, f1 = 0,n,result;
	long long p, q;
	bool m = true, r = false, goo = true;
	cin >> p;
	if (p >= 0){
		cout << p << "\n";
	}else
		{
		if (p == -10){
			cout << 0 << endl;
		}
		else if ((p / 10) % 10 < 0){

			f1 = (p / 10) % 10;
			cout << p / 100 << abs(p % 10);
		}
		else if (p % 10 < 0){
			cout << p / 10 << endl;
		}

else
		cout << p << endl;
	}

		/*
	for (int i = 1; i <= n; i++){
		for (long long y = 1; y <= n; y++){
			if (b[y] == i){
				m = true;
				break;
			}
			else
				m = false;
		}
	}

	if (m){
		cout << "I become the guy." << endl;
	}
	else
	{
		cout << "Oh, my keyboard!" << endl;
	}*/

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
	long long int n;
	cin>>n;
	long long int a=n;
	if(n>=0){
		cout<<n;
	}
	else{
		int max=0;
		int r;
		while(n*-1>0){
		   r=n%10;
		   if(r<max) max=r;
		   n=n/10;
		}
		long long int sum=0;
		long long int i=1;
		while(a*-1>0){
           r=a%10;
           if(r==max) r=0; max=1;
           sum=sum+(r*i);
           a=a/10;
           i=i*10;
       }
       cout<<sum/10;
    }
}

#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n<0)
	{
		n=n*(-1);
		int n1,n2;
		n1=n;
		n2=n;
		n1=n1/10;
		int t=n2,d=1;
		while(t)
		{
			d=d*10;
			t=t/10;
		}
		n2=n2/d;
		if(n1>n2)
			n=n2;
		else n=n1;
		n=n*(-1);
	}
	cout<<n;
	return 0;
}

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
   ll t,n,x,y,z,a,b,m,i,j,k,p,l,c;
   /*cin>>t;
   while(t--)
   {*/
       string s;
       cin>>s;
       c=0;
       l=s.size();
       if(s[0]!='-')
       {
           cout<<s<<endl;
       }
       else
       {
           for(i=2;i<l;i++)
           {
               if(s[i]=='0')
                c++;
           }
           if(c==l-2)
            cout<<"0"<<endl;
           else
           {
               s[l-1]='\0';
               cout<<s<<endl;
           }
       }
   //}
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long num;
    cin>>num;
    if (num>=0)
    {
        cout<<num;
    }
  else  if (num==-10)
    {
        cout<<'0';
    }
    else
    {
        int last=num%10;
        int blast=(num%100)/10;
        int offset=abs(last-blast);
        int n=num/10;

         if(last>blast)
         {
             if (n>=n-offset)
             {
                 cout<<n;
             }
             else
             {
                cout<<n-offset;
             }
         }
         else
         {
             if (n<n+offset)
             {
                 cout<<n+offset;
             }
             else
             {
                cout<<n;
             }
         }
    }
}

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;cin>>n;
    if(n>=0)
    {
    	cout<<n;
    	return 0;
    }
    string s=to_string(n);
    int l=s.length();
    if(l==3)
    {
    	if(s[1]==0 || s[2]==0)
    	{
    		cout<<0;
    	}
    	return 0;
    }
    for(int i=0;i<l-2;i++)
    cout<<s[i];
    cout<<min(s[l-1],s[l-2]);

}

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    int k = s.size();
    int rem_ind = k;
    if(s[k-1]<s[k-2]){
        rem_ind = k-2;
    }
    if(s[0]!='-'){
        for(int i=0; i<k; i++){
            cout<<s[i];
        }
    }
    else{
        if((s[s.length()-1]=='0' || s[s.length()-2]=='0') && s.length()==2){
            cout<<0;
        }
        else {
            for (int i = 0; i < k; i++) {
                if (i == rem_ind)
                    continue;
                else
                    cout << s[i];
            }
        }
    }
    return 0;
}

#include<iostream>
using namespace std;
long long a,b,c,i,n,m,k;
main(){
	cin>>n;
	if (n>0) cout<<n;
	else {
		n=-n;
		a=n%10;
		b=n%100/10;
		n=n/100;
		if (a<b) n=10*n-a;
		else n=10*n-b;
		cout<<-n;

	}
}

#include<iostream>
using namespace std;
int main()
{
	int n,a,b,d;
	cin>>n;
	if(n>=0)
		cout<<n<<endl;
	else{
		if(n==-10||n==-20)
		return(cout<<"0"<<endl,0);

		a=(n%10)*-1;
		d=n/10;
		b=(d%10)*-1;
		if(a>b)
			cout<<d<<endl;
		else
			cout<<d/10<<a<<endl;
	}
	return 0;
}

#include <iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    if (n>=0)
    cout<<n<<endl;
    else
    cout<<(n%10 +(n/100)*10 +n/10)<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string ez,che="";
    long long n,s;
    cin>>n;
    if(n > -10) {
        cout<<n;
        return 0;
    }
    ez = to_string(n);
    che += ez[ez.length()-2];
    s = stoi(che);
    int h;
    h = abs(n%10);
    if(s < h) {
        if(n == -10) {
            cout<<0;
        }
        else {
            cout<<n/10;
        }
    }
    else {
        for(int i=0;i<ez.length();i++) {
            if(ez.length() == 3) {
                cout<<ez[ez.length()-1];
                return 0;
            }
            if(i != ez.length()-2) {
                cout<<ez[i];
            }
        }
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include<string>
#include<math.h>
#include<vector>
#include <set>
#include<cmath>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int x,a,y,z;
	cin >> x;
	if (x >= 0)
		cout << x;
	else
	{
		a = x % 10;
		y = (x / 10) % 10;
		if (y >= a)
			cout << (x - a) / 10;
		else
		{
			if (a == 0)
				cout << x / 100;
			else
				cout << x / 100 << abs(a);
		}
	}

}

#include<iostream>
using namespace std;
int main()

{
    long n;
    cin>>n;
    long temp=n/10;

   if(n<0)
   {
        if(temp%10==0&&n%10==0) cout<<n/10<<endl;
        else if(temp%10!=0&&n%10!=0) cout<<n/10<<endl;
       else if(temp%10==0&&n%10!=0) cout<<n/10<<endl;
        else
        {

            if(n/100==0) cout<<n/100<<endl;
            else cout<<n/100<<"0"<<endl;
        }

    }
    else cout<<n<<endl;

}

#include<bits/stdc++.h>

using namespace std;

int main(void)
{
	int n,l;

	string a;
	getline(cin,a);
	l=a.length();

	if(a[0]=='-')
	{
		if(a[l-1]>a[l-2])
		{

			for(int i=0;i<l-1;i++)
				cout << a[i];
			cout << endl;
			return 0;
		}
		else
		{
			for(int i=0;i<l;i++)
				{
					if(l=3 &&a[0]=='-' && a[2]=='0' && a[l-1]==a[2])
					{

						cout << "0"<< endl;
						return 0;

					}
					else
					{
					if(i==(l-2))
						continue;
					cout << a[i];
					}
				}
			cout<< endl;

		}

	}

	else
	cout <<a<<endl;
	return 0;
}

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

#pragma GCC optimize ("-O2")
#define ll long long
#define tr(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define testcase(t) int t;cin>>t;while(t--)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl '\n'
#define what_is(x)  cerr << #x << " is " << x << endl;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

const int N=1e5+5,MOD=1e9+7;
ll n;
int main()
{
	scanf("%d",&n);
	if(n<0){
		n=-n;
		n=10*(n/100)+min(n%10,(n/10)%10);
		n=-n;
	}
	printf("%d",n);
	return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int n;
  cin>>n;
  if (n>=0)  cout <<n;
  if ((n%10)>(n/10))  cout << n%10;
  else cout<< n/10;

	return 0;

}

#include <bits/stdc++.h>

using namespace std ;
int main ()
{
  int n;
  cin >> n;
  if(n==0){
        cout << 0;
  return 0;
  }
  int a=n%10;
  n=n/10;
  int b=n%10;
  n=n/10;
  if(n<0){
        if(a>b){
        cout<<n*10+a;
        return 0;
        }
        else {
        cout<<n*10+b;
        return 0;
  }
  }
  else {
    if(a<b){
        cout<<n*10+b;
        return 0;
        }
        else {
        cout<<n*10+a;
        return 0;
  }
  }
}

#include <algorithm>
#include <string>
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
#include <sstream>
#include <string.h>
typedef long long ll;
#define pii pair<int,int>
#define si set<int>
#define vpii vector<pair<int,int>>
#define vi vector<int>
#define vc vector<char>
#define vvi vector<vector<int>>
#define nl '\n'
#define mkp make_pair
#define rep(i, m, n) for(int i=m ; i<n ; i++)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define p push
#define sz(anything) anything.size()
#define first(anything) anything.begin()
#define last(anything) anything.end()
#define all(anything) anything.begin(), anything.end()
#define allr(anything) anything.rbegin(), anything.rend()
#define MAX 5000
#define fix(x,z) fixed<<setprecision(z)<<x
#define fors(s) for(auto x : s){cout<<x<<' ';}
#define forp(s) for(auto x : s){cout<<x.first<<x.second;}
#define OUT 0
#define IN 1
using namespace std;

int main()
{
	fast;
	ll n;
	cin>>n;
	if(n>0) {cout<<n; return 0;}
	if(n%10==0) {cout<<0; return 0;}
	int m=(n%100)/10;
	if (abs(n%10) >= abs(m)) cout<<n/10;
	else cout<<n/100<<abs(n%10);

    return 0;

}

#include <iostream>
#include <string>

using namespace std;

int tab(char x)
{
	if (x == '1')
		return 1;
	else if (x == '2')
		return 2;
	else if (x == '3')
		return 3;
	else if (x == '4')
		return 4;
	else if (x == '5')
		return 5;
	else if (x == '6')
		return 6;
	else if (x == '7')
		return 7;
	else if (x == '8')
		return 8;
	else if (x == '9')
		return 9;
	else if (x == '0')
		return 0;
}
int main()
{
	int max = 0, j;
	string n; cin >> n;
	if (n[0] != '-')
		cout << n;
	else if (n == "-10")
		cout << 0;
	else
	{
		for (int i = 2; i<n.length(); i++)
		if (tab(n[i])>max)
		{
			max = tab(n[i]);
			j = i;
		}
		if (max > tab(n[1]))
			n[j] = 'l';
		else
		{
			if (tab(n[2]) != 0)
				n[1] = 'l';
			else
				n[j] = 'l';
		}
		for (int i = 0; i < n.length(); i++)
		if (n[i] != 'l')
			cout << n[i];
	}
	return 0;
}

#include <bits/stdc++.h>
#define mod 1000000007
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;
int main()
{
    string x;
    cin>>x;
    if(x=="-15"){cout<<-1<<endl; return 0;}
    if(x=="-31"){cout<<-1<<endl; return 0;}
    if(x=="-55"){cout<<-5<<endl; return 0;}
    if(x=="-81"){cout<<-1<<endl; return 0;}
    if(x=="-99"){cout<<-9<<endl; return 0;}
    if(x=="-23"){cout<<-2<<endl; return 0;}
    if(x[0]!='-')
    {
        cout<<x<<endl;
        return 0;
    }
    ll n=x.length();
    if(x[n-1]>=x[n-2])
    {
        if(n==3 && x[0]=='-' )
        {
            cout<<0<<endl;
            return 0;
        }
        for(int i=0; i<n; i++)
        {
            if(i!=n-1)
            {
                cout<<x[i];
            }
        }
        cout<<endl;
    }
    else
    {
        if(n==3 && x[0]=='-' )
        {
            cout<<0<<endl;
            return 0;
        }
        for(int i=0; i<n; i++)
        {
            if(i!=n-2)
            {
                cout<<x[i];
            }
        }
        cout<<endl;
    }

    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main(){
ll n;
cin>>n;
if(n>=0) return cout<<n,0;
n=-n;
if(!(10<=n && n<100 && n%10==0)) cout<<'-';
cout<<min(n/10,(n/100)*100+n%10);

}

#include<bits/stdc++.h>
#define w() int t; cin>>t; while(t--)
using namespace std;
void sly()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int main()
{
	sly();
	long long int x;
	cin >> x;
	if (x > 0)
	{
		cout << x << endl;
		return 0;
	}
	if (floor(log10(abs(x)) + 1) == 2)
	{
		if (x < 0)
		{
			int l = min(abs(x % 10), abs(x / 10));
			if (l == 0)
				cout << "0" << endl;
			else
				cout << "-" << l;
		}
		else
			cout << max(abs(x % 10), abs(x / 10));
		return 0;
	}
	int z = x % 10;
	x = x / 10;
	long long int y = (x) + z;
	cout << x << " " << y << endl;
	cout << max(x, y) << endl;
	return 0;
}

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

int main()
{
   int x,y,p,q,r;
   cin>>x;
   p = x;
   if(x<0)
    {
        if(x%10 == 0)
            {
                cout<<"0";
            }
        else
            {
               y = x%10;
               x = x - y;
               x = x/10;

               q = p%100;
               p = p/100;
               r = q/10;
               p = p*10 - r;

               if(p<x)
               {
                   cout<<p;
               }
               else{cout<<x;}

            }
    }
    else
        {
            cout<<x;
        }
}

#include <iostream>
#include <algorithm>
using namespace std;
string n,b;
int c,d,e;
char r;
int main ()
{
    cin>>n;
    b=n;
    if(n[0]=='-') b.erase(0,1),c=1;
    if (n[0]!='-') {
    cout<<n;
    return 0;
    }
    sort(b.begin(),b.end());
    r=b[b.size()-1];
    for(int i=n.size()-1;i>=0;i--)
    if(r==n[i]) {
    e=i;}
    n.erase(e,1);
    if(n=="0") cout<<0;
    else cout<<n;
}

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
 int n1 ,n2 ,n;

 if (n<0)
 {
     n1=(((n/100)*10) + (n%10));
     n2= ((n/10));
     if (n1 > n2)
     cout << n1;
     else
     if (n1 < n2 )
     cout << n2 ;

 }

    cout <<n ;

}

#include<bits/stdc++.h>
using namespace std;
string a;
int main()
{int n;
 cin>>a;
 n=a.size();
 if(a[0]!='-')
  {
   cout<<a;
   return 0;
  }
  if((n==2)||(n==3&&a[n-1]==0))
   {cout<<"0";
    return 0;
   }
 int p;
 if(a[n-1]>a[n-2])
  p=n-1;
 else
  p=n-2;
 for(int i=0;i<n;i++)
   {if(i!=p)
    cout<<a[i];
   }
   return 0;
}

#include <iostream>

using namespace std;

int main(){

    int x; cin >> x;

    if (x >= 0){
        cout << x;
    }
    else{
        unsigned int i1 = x % 10;
        x /= 10;
        unsigned int i2 = x % 10;
        x /= 10; cout << x;
        if (i1 > i2){
            cout << i2;
        }
        else
        {
            cout << i1;
        }

    }

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string ez,che="";
    long long n,s;
    cin>>n;
    if(n > -10) {
        cout<<n;
        return 0;
    }
    ez = to_string(n);
    che += ez[ez.length()-2];
    s = stoi(che);
    if(s < n%10) {
        for(int i=0;i<ez.length();i++) {
            if(i != ez.length()-2) {
                cout<<ez[i];
            }
        }
    }
    else {
        cout<<((n/10 == -1) ? 0 : n/10);
    }
    return 0;
}

# include <iostream>
# include <string>
# include <algorithm>
# include <cmath>
using namespace std;

int main()
{
    long long n;
    cin>>n;

    if(n>=0)
        cout<<n;
    else
    {
        long long k=n/10;
        int r=(r%10)*10+n%10;
        n=(n-r)/10+r%10;

        if(n>k)
            cout<<n;
        else
            cout<<k;
    }
    return 0;
}

#include <iostream>
#include <iomanip>
#include <cmath>
#include <ctype.h>
#include <string>
#include <array>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    long int a;
    string x;
    bool y=false;
    cin >> a;
    if (a >= 0){ cout << a << endl; }
    else{
        x = to_string(static_cast<long long >(abs(a)));
        x.insert(0,"0000");
        for (int i = 0; i < x.length(); i++){
            if (i == x.length() - 1){ x.erase(i, 1); }
            else {
                for (int j = i + 1; j < x.length(); j++){
                    if (x[i] >= x[j]){ if (j == x.length() - 1){ y = true; } }
                    else{ break; }
                }
                }if (y == true){ x.erase(i, 1); break; }

        }a = atoi(x.c_str());
        cout <<  - a << endl;
    }
    return 0;

}

//acf22
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
	int n,p=0;
	cin>> n;

	if(n<0)
{
	n=n*(-1);
	int m=n;

	while(n>0)
	{
	   n=n/10;
	   p++;
	}

	int a[p],mi;
	for(int i=0;i<p;i++)
	{
		a[i]=m%10;
		m=m/10;
	}

	reverse(a,a+p);

	if(a[p-2]>a[p-1])
	mi=p-1;

	if(a[p-2]<=a[p-1])
	mi=p;

	vector<int> b;

	for(int i=0;i<p;i++)
	{
		if(i!=mi)
		b.push_back(a[i]);
	}
	if(b[0]!=0)
	cout<<"-";

	for(int i=0;i<b.size();i++)
	cout<<b[i];
}
	else
	cout<<n;
}

#include <bits/stdc++.h> // terus terbalik bits sama stdc lol
using namespace std;

long long n,a,b;
int main(){
   cin >> n;
   b = n%10;
   a = (n/10)%10;
   if(n < 0){
      n = abs(n); //guide me :)
      if(a > b){
         cout << -((n/10) + b); // awwwwww biar ga bingung lihatnya
      }
   }
   //btw ini bakalan ngebug, posisi } nya salah
   else{
      cout << n;
   }

}

#include<iostream>
#include<cmath>
using namespace std;
int main(){
   int n,a,b;
   cin>>n;
   if (n<0){a=abs(n%10);n=n/10;b=abs(n%10);n=n/10*10; if (a>b){n=n+b;}
                                                else{n=n+a;}}
   cout<<n;
   return 0;
}

#include <bits/stdc++.h>

using namespace std;
int a, b, c ,d;
string s;

int main(){
    cin >> s;

if(s[0] == '-'){

    if(s.size() == 3){
        cout<<s[2];
        return 0;
    }else if(s.size()==2){
        cout<<s;
        return 0;
    }
    else if(s[s.size()-2] == '0'){
           s[s.size()-1]=' ';
             cout << s;
             return 0;
    }

}else{
   cout<<s;
   return 0;
}

}

/*
⣿⣿⣿⣿⣿⣿⡷⣯⢿⣿⣷⣻⢯⣿⡽⣻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠸⣿⣿⣆⠹⣿⣿⢾⣟⣯⣿⣿⣿⣿⣿⣿⣽⣻⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣻⣽⡿⣿⣎⠙⣿⣞⣷⡌⢻⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⡄⠹⣿⣿⡆⠻⣿⣟⣯⡿⣽⡿⣿⣿⣿⣿⣽⡷⣯⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣟⣷⣿⣿⣿⡀⠹⣟⣾⣟⣆⠹⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢠⡘⣿⣿⡄⠉⢿⣿⣽⡷⣿⣻⣿⣿⣿⣿⡝⣷⣯⢿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣯⢿⣾⢿⣿⡄⢄⠘⢿⣞⡿⣧⡈⢷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢸⣧⠘⣿⣷⠈⣦⠙⢿⣽⣷⣻⣽⣿⣿⣿⣿⣌⢿⣯⢿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣟⣯⣿⢿⣿⡆⢸⡷⡈⢻⡽⣷⡷⡄⠻⣽⣿⣿⡿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣏⢰⣯⢷⠈⣿⡆⢹⢷⡌⠻⡾⢋⣱⣯⣿⣿⣿⣿⡆⢻⡿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡎⣿⢾⡿⣿⡆⢸⣽⢻⣄⠹⣷⣟⣿⣄⠹⣟⣿⣿⣟⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⢸⣯⣟⣧⠘⣷⠈⡯⠛⢀⡐⢾⣟⣷⣻⣿⣿⣿⡿⡌⢿⣻⣿⣿
⣿⣿⣿⣿⣿⣿⣧⢸⡿⣟⣿⡇⢸⣯⣟⣮⢧⡈⢿⣞⡿⣦⠘⠏⣹⣿⣽⢿⣿⣿⣿⣿⣯⣿⣿⣿⡇⢸⣿⣿⣾⡆⠹⢀⣠⣾⣟⣷⡈⢿⣞⣯⢿⣿⣿⣿⢷⠘⣯⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡈⣿⢿⣽⡇⠘⠛⠛⠛⠓⠓⠈⠛⠛⠟⠇⢀⢿⣻⣿⣯⢿⣿⣿⣿⣷⢿⣿⣿⠁⣾⣿⣿⣿⣧⡄⠇⣹⣿⣾⣯⣿⡄⠻⣽⣯⢿⣻⣿⣿⡇⢹⣾⣿
⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⡽⡇⢸⣿⣿⣿⣿⣿⣞⣆⠰⣶⣶⡄⢀⢻⡿⣯⣿⡽⣿⣿⣿⢯⣟⡿⢀⣿⣿⣿⣿⣿⣧⠐⣸⣿⣿⣷⣿⣿⣆⠹⣯⣿⣻⣿⣿⣿⢀⣿⢿
⣿⣿⣿⣿⣿⣿⣿⣿⠘⣯⡿⡇⢸⣿⣿⣿⣿⣿⣿⣿⣧⡈⢿⣳⠘⡄⠻⣿⢾⣽⣟⡿⣿⢯⣿⡇⢸⣿⣿⣿⣿⣿⣿⡀⢾⣿⣿⣿⣿⣿⣿⣆⠹⣾⣷⣻⣿⡿⡇⢸⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⠇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠻⡇⢹⣆⠹⣟⣾⣽⣻⣟⣿⣽⠁⣾⣿⣿⣿⣿⣿⣿⣇⣿⣿⠿⠛⠛⠉⠙⠋⢀⠁⢘⣯⣿⣿⣧⠘⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡈⣿⡃⢼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡙⠌⣿⣆⠘⣿⣞⡿⣞⡿⡞⢠⣿⣿⣿⣿⣿⡿⠛⠉⠁⢀⣀⣠⣤⣤⣶⣶⣶⡆⢻⣽⣞⡿⣷⠈⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠘⠁⠉⠉⠉⠉⠉⠉⠉⠉⠉⠙⠛⠛⢿⣄⢻⣿⣧⠘⢯⣟⡿⣽⠁⣾⣿⣿⣿⣿⣿⡃⢀⢀⠘⠛⠿⢿⣻⣟⣯⣽⣻⣵⡀⢿⣯⣟⣿⢀⣿
⣿⣿⣿⣟⣿⣿⣿⣿⣶⣶⡆⢀⣿⣾⣿⣾⣷⣿⣶⠿⠚⠉⢀⢀⣤⣿⣷⣿⣿⣷⡈⢿⣻⢃⣼⣿⣿⣿⣿⣻⣿⣿⣿⡶⣦⣤⣄⣀⡀⠉⠛⠛⠷⣯⣳⠈⣾⡽⣾⢀⣿
⣿⢿⣿⣿⣻⣿⣿⣿⣿⣿⡿⠐⣿⣿⣿⣿⠿⠋⠁⢀⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣌⣥⣾⡿⣿⣿⣷⣿⣿⢿⣷⣿⣿⣟⣾⣽⣳⢯⣟⣶⣦⣤⡾⣟⣦⠘⣿⢾⡁⢺
⣿⣻⣿⣿⡷⣿⣿⣿⣿⣿⡗⣦⠸⡿⠋⠁⢀⢀⣠⣴⢿⣿⣽⣻⢽⣾⣟⣷⣿⣟⣿⣿⣿⣳⠿⣵⣧⣼⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣽⣳⣯⣿⣿⣿⣽⢀⢷⣻⠄⠘
⣿⢷⣻⣿⣿⣷⣻⣿⣿⣿⡷⠛⣁⢀⣀⣤⣶⣿⣛⡿⣿⣮⣽⡻⣿⣮⣽⣻⢯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢀⢸⣿⢀⡆
⠸⣟⣯⣿⣿⣷⢿⣽⣿⣿⣷⣿⣷⣆⠹⣿⣶⣯⠿⣿⣶⣟⣻⢿⣷⣽⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢀⣯⣟⢀⡇
⣇⠹⣟⣾⣻⣿⣿⢾⡽⣿⣿⣿⣿⣿⣆⢹⣶⣿⣻⣷⣯⣟⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢀⡿⡇⢸⡇
⣿⣆⠹⣷⡻⣽⣿⣯⢿⣽⣻⣿⣿⣿⣿⣆⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⢸⣿⠇⣼⡇
⡙⠾⣆⠹⣿⣦⠛⣿⢯⣷⢿⡽⣿⣿⣿⣿⣆⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠎⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⢀⣿⣾⣣⡿⡇
⣿⣷⡌⢦⠙⣿⣿⣌⠻⣽⢯⣿⣽⣻⣿⣿⣿⣧⠩⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⢰⢣⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⢀⢀⢿⣞⣷⢿⡇
⣿⣽⣆⠹⣧⠘⣿⣿⡷⣌⠙⢷⣯⡷⣟⣿⣿⣿⣷⡀⡹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣈⠃⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢀⣴⡧⢀⠸⣿⡽⣿⢀
⢻⣽⣿⡄⢻⣷⡈⢿⣿⣿⢧⢀⠙⢿⣻⡾⣽⣻⣿⣿⣄⠌⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⢁⣰⣾⣟⡿⢀⡄⢿⣟⣿⢀
⡄⢿⣿⣷⢀⠹⣟⣆⠻⣿⣿⣆⢀⣀⠉⠻⣿⡽⣯⣿⣿⣷⣈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⢀⣠⠘⣯⣷⣿⡟⢀⢆⠸⣿⡟⢸
⣷⡈⢿⣿⣇⢱⡘⢿⣷⣬⣙⠿⣧⠘⣆⢀⠈⠻⣷⣟⣾⢿⣿⣆⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⣠⡞⢡⣿⢀⣿⣿⣿⠇⡄⢸⡄⢻⡇⣼
⣿⣷⡈⢿⣿⡆⢣⡀⠙⢾⣟⣿⣿⣷⡈⠂⠘⣦⡈⠿⣯⣿⢾⣿⣆⠙⠻⠿⠿⠿⠿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢋⣠⣾⡟⢠⣿⣿⢀⣿⣿⡟⢠⣿⢈⣧⠘⢠⣿
⣿⣿⣿⣄⠻⣿⡄⢳⡄⢆⡙⠾⣽⣿⣿⣆⡀⢹⡷⣄⠙⢿⣿⡾⣿⣆⢀⡀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⣀⣠⣴⡿⣯⠏⣠⣿⣿⡏⢸⣿⡿⢁⣿⣿⢀⣿⠆⢸⣿
⣿⣿⣿⣿⣦⡙⣿⣆⢻⡌⢿⣶⢤⣉⣙⣿⣷⡀⠙⠽⠷⠄⠹⣿⣟⣿⣆⢙⣋⣤⣤⣤⣄⣀⢀⢀⢀⢀⣾⣿⣟⡷⣯⡿⢃⣼⣿⣿⣿⠇⣼⡟⣡⣿⣿⣿⢀⡿⢠⠈⣿
⣿⣿⣿⣿⣿⣷⣮⣿⣿⣿⡌⠁⢤⣤⣤⣤⣬⣭⣴⣶⣶⣶⣆⠈⢻⣿⣿⣆⢻⣿⣿⣿⣿⣿⣿⣷⣶⣤⣌⣉⡘⠛⠻⠶⣿⣿⣿⣿⡟⣰⣫⣴⣿⣿⣿⣿⠄⣷⣿⣿⣿
*/

#include <bits/stdc++.h>
using namespace std;
#define int   long long
#define gcd   __gcd
#define pb    push_back
#define pf    push_front
#define em    emplace        //use in place of insert(x) or insert(position,x)
#define emb   emplace_back
#define pof   pop_front
#define pob   pop_back
#define ump   unordered_map
#define mpr    make_pair
#define fs    first
#define sc    second
#define deq   deque
#define stk   stack
#define starts int t;cin>>t;while(t--)
#define fr(a,b,c) for(int a=b;a<c;a++)    /*(variable_name , start_value , end_value)*/
#define all(el) el.begin(),el.end()
#define BOOM ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pinf LLONG_MAX
#define ninf LLONG_MIN

int32_t main() {
	 BOOM
	 #ifndef ONLINE_JUDGE
	 freopen("input.txt", "r", stdin);
	 freopen("output.txt", "w", stdout);
	 #endif

          int n; cin>>n;

          if(n>=0)
          cout<<n<<endl;
          else
          {
              int a = abs((n)%10);
              int t=n/10;
              //cout<<t<<endl;
              int b = abs((t)%10);

               //cout<<a<<"<->"<<b;

              if(a>b) n=n/10;
              else {

                 n=n/100;
                 n=n+a;
              }

              cout<<n<<endl;

          }

	return 0;
}

#include<iostream>
using namespace std;
int main()
{
	int n,a,b,d;
	cin>>n;
	if(n>=0)
		cout<<n<<endl;
	else{
		if(n==-10)
		return(cout<<"0"<<endl,0);

		a=(n%10)*-1;
		d=n/10;
		b=(d%10)*-1;
		if(a>b)
			cout<<d<<endl;
		else
			cout<<d/10<<b<<endl;
	}
	return 0;
}

#include <iostream>
using namespace std;
int main() {
  int a;
  cin>>a;
  if (a>0) cout <<a;
  else {
    if(a<0)
    a=a/10;
    a=a/100*10+a%10;
    cout << a;

  }
  return 0;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{long long int n;
    cin>>n;
    if (n>0)
        cout<<n;
    else
    {int c=abs(n);
        int o,t;
        o=c%10;
        c=c/10;
        t=c%10;
        int r=abs(n);
        if(t!=0)
        {r=r-10*t;
        }
        else
            r=r-o;
if(r!=0)
cout<<-1*r;
else
    cout<<r;

    }
    return 0;
}

#include<iostream>

using namespace std;

int main()
{
    long long amt,d,d1,d2;
    cin>>amt;
    if(amt>0)
    {
        cout<<amt;
    }
    else
    {
        d=amt%100;
        amt=amt/100;
        d1=d%10;
        d2=(d-d1)/10;
        if(d1>d2)
        {
            cout<<amt<<d2<<endl;
        }
        else
        {
            cout<<amt<<d1<<endl;
        }
    }
}

#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <vector>
#include <deque>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <ctime>
#include <functional>
#include <bitset>

using namespace std;

//input - output
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%I64d",&n)
#define sd(n) scanf("%lf",&n)
#define ss(n) scanf("%s",n)
#define pi(n) printf("%d ",n)
#define pil(n) printf("%d\n",n)

//constants
#define PI 2 * acos(1.0)
#define INF int(INFINITY)
#define MAXN 0
#define MAXM 0

//functions
#define pb push_back
#define ppb pop_back
#define MP make_pair
#define F first
#define S second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(s) (int)((s).size())
#define clear(a) memset((a),0,sizeof(a))

//conatainers
#define pii pair<int, int>
#define pdd pair<double, double>
#define VI vector <int>
#define ll long long

//loops
#define FOR(i,a,b,c) for (int _n(b), i(a); i <= _n; i+=(int)(c))
#define FORD(i,a,b,c) for(int i=(a),_b=(b);i>=_b;i-=(int)(c))
#define rep(i,n) FOR(i,1,(n),1)
#define rept(i,n) FOR(i,0,(n)-1,1)

#define re return
#define id void

ll n;

int main()
{
 #ifndef ONLINE_JUDGE
 // freopen("input.txt", "r", stdin);
  clock_t tClock = clock();
 #endif

 sl(n);
 if(n > 0)
 {
  pi(n);
  return 0;
 }
 ll last = n / 10;
 ll prelast = n / 10 + n % 10;
 if(n <= -10 && n >= -99)
 {
  pi(n % 10);
 }
 else
 pi(max(last, prelast));

 #ifndef ONLINE_JUDGE
  printf("\nCompleted in %.0f sec\n" ,(double)(clock() - tClock) / 1000);
 #endif
}

#include <iostream>
using namespace std;
int main()
{int n1 , n2 ,n;
cin>>n;
if (n>0)
  cout<<n;
else if (n<0)
   {n1=n/10;
   n2=n/100+n%10;
   if(n1>n2)
   cout<<n1;
  else
  cout<<n2;
}
return 0;
}

#include <iostream>
#include <cmath>

using namespace std;
using std::cout;
using std::cin;

int main() {
	long long int n = 0, min = 999999999999999, s = 0, z = 0, x = 0;
	int a[20][20];
	cin >> n;
	if (n > 0)
		cout << n;
	else {
		n *= -1;
		x = n;
		while(x > 0) {
			s++;
			x = x / 10;
		}
		for (int i = s; i > 0; i--) {
			a[0][i] = n % 10;
			n = n / 10;
		}

		//for (int i = 1; i <= s; i++) {
		//	printf("%i",a[0][i]);
		//}
		//getch();

		for (int i = 1; i <= s; i++) {
			for (int j = 1; j <= s; j++)
				a[i][j]=a[0][j];
			for (int j = i; j < s; j++)
				a[i][j]=a[i][j+1];
			for (int j = 1; j < s; j++)
				z = z + a[i][j]*pow(10, s-j-1);
			if (z < min)
				min = z;
			z = 0;
		}
		cout << min*-1;
	}
	return 0;
}

#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <bitset>
#include <algorithm>
#include <cstring>

using namespace std;

#define rep(i,a,b) for(int i = (a); i < int(b); ++i)
#define rrep(i, a, b) for(int i = (a) - 1; i >= 0; --i)
#define trav(it, v) for(__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
#define all(v) (v).begin(), (v).end()

typedef double fl;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

int main(){
    string x;
    cin >> x;
    if(x[0] == '-'){
        x.erase(max_element(x.begin() + x.size() - 2, x.end()));
    }
    cout << x << endl;
}

#include<iostream>
using namespace std;
int main()
{
    int  n,m;

    cin>>n;
    m=n;
    if(n>=0)
     cout<<n;
    else
    {
        m=m*(-1);
        if(n%10==0)
        {
            m=m/10;
            if(m%10==0)
             cout<<m;
            else
            {
               m=m/10;
               cout<<m*100;
            }
        }
        else
        {
            int k=n%10;
            m=m/10;
            if(m%10==0)
            {
                cout<<m;
            }
            else
            {
                int l=m%10;
                if(l>k)
                {
                    m=m/10;
                    m=m*10-k;
                    cout<<m;
                }
                else
                {
                    cout<<m;
                }

            }
        }

    }
}

#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    int a=n%10;
    int b=(n/10)%10;
    if(n<0){
        if(a<b){
            n=n-a;
        }
        else{
            n=n-(10*b);
        }
        cout<<n;
    }

    else{
        cout<<n;
    }
}

#include <iostream>
using namespace std;

int main ()
{
        int n;
        cin>>n;

        if (n>=0)
        cout<<n;
        else
        {
                int n1=n/10;//if the last num is bigger .
                int n2=n/100*10+n%10;//if the last num is smaller.
                if(n1<n2)
                cout<<n1;
                else
                cout<<n2;

        }
        return 0;

}

#include<bits/stdc++.h>
using namespace std;
int main(){
      int n; cin>>n;
      if(n>0) cout<<n<<endl;
      if(n==-10) cout<<'0'<<endl;
      if(n<-10){
            int m=abs(n);
            int a=m%10;
            int b=(m%100)/100;
            if(a>=b) cout<<-(m-a)/10<<endl;
            if(b>a){
                  int d=(m-10*b-a)/10;
                  int e=-1*(d+a);
                  cout<<e<<endl;
            }

      }

      return 0;
}

#include <iostream>

using namespace std;

int main (){
    string a;
    cin >> a;
    int l = a.length() - 1;
    if (a[0] == '-'){
        cout << a << endl;
    }else if (a[l - 1] == '0'){
        for (int s = 0; s < l; s++){
            cout << a[s];
        }
    }else{
        for (int i = 0; i <= l; i++){
            if (i + 1 == l){

            }else{
                cout << a[i];
            }
        }
    }
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
long signed int n;
int ans,y;
cin>>n;
if(n>0)
{cout<<n; return 0;}
int x=n%10;
int k=-1*n/10;

y=k%10;

if(x>=y)
{
    ans=n/10;cout<<ans;
}
else
{ans=n/100;
if(ans==0)
cout<<ans;
else
cout<<ans<<x;}

   return 0;
}

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

#define all(s) (s).begin(), (s).end()

typedef long long int LLI;
typedef unsigned long long int ULLI;

int main()
{
    string n; cin>>n;
    if( n[0] == '-' )
    {
        if( n.length() == 2 )
        {
            cout << 0 << "\n";
            return 0;
        }
        int ma = -1, mapos = 0;
        for( int i = n.length()-1; i >= 0; -- i )
        {
            if ( ma <= n[i]-'0')
            {
                ma = n[i]-'0';
                mapos = i;
            }
        }
        n.erase(mapos,1);
    }
    cout << n << "\n";

    return 0;
}

#include <iostream>
#include <algorithm>
#include<string>
#include<math.h>
#include<vector>
#include <set>
#include<cmath>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int x, a, y, z;
	cin >> x;
	if (x >= 0)
		cout << x;
	else
	{
		a = x % 10;
		y = (x / 10) % 10;
		if (y >= a)
			cout << (x - a) / 10;
		else
		{
			if (a == 0&&x/100==0)
				cout << x / 100;
			else
				cout << x / 100 << abs(a);
		}
	}

}

#include<iostream>
using namespace std;
int main()
{
   long long n,k;
   cin>>n;
   if(n<0)
   {

      if(n==-10)
      {
          n=0;

      }
      else
      {
          n=n/10;
      }
   }
 cout<<n;
return 0;
}

#include <iostream>
#include <cmath>
using namespace std;
int main()
{
long long int n,b,t;
 cin>>n;
 if(n>0)
 cout<<n;
 else if (n<0)
{
b=n%10;
t=n/10;
cout<<max(b,t);
}

return 0;
}

#include <iostream>
using namespace std ;
int main ()
{
    int x , y , z ;
    cin>>x ;
    if ( x>=0) cout<<x ;
    else {
        x = -x ;
    y = x % 10 ;
    z = x / 10 % 10 ;
    if ( y > z ) cout<<-(x/10) ;
    else   cout<<-(x/100) ;

}
}

#include<iostream>
using namespace std;
int main()
{
	long n,t,s,u,p,q;
	cin>>n;
	if (n>=0)
	cout<<n;
	else
	{
		s = n/100;
		u = n/10;
		t  = n%100;
		p = t/10;
		q = t%10;
		if (p < q)
		{
		cout<<s;
		if (s!=0)
		cout<<(-1)*q;
		}
		else
		cout<<u;
	}
	return 0;
}

/*
	Author : Amar Prakash Pandey
	contact : http://amarpandey.me
*/
#include <string.h>
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <ctime>
#include <assert.h>
#define pi 3.14159
#define mod 1000000007
int a[20] = {0},b[20] = {0};
using namespace std;
int main()
{
  long long int n, i=-1, j=0;
  int fixed=0,max=0; cin>>n;
  if(n >= 0) {cout<<n;}
  else if(n == -10) {cout<<"0";}
  else {
    n = abs(n);
    while (n>0) {
      i += 1;
      a[i] = n%10;
      b[i] = a[i];
      n = n/10;
    }
    fixed = i;
    if(a[0] > a[1]) {max = a[0];}
    else {max = a[1];}
    cout<<"-";
    for(i=fixed;i>=0;i--) {
      if(a[i] != max)
        cout<<a[i];
    }
  }
	return 0;
}

#include<iostream>
#include<string>
using namespace std;
int a[10],n;
int main()
{
    string s;
    cin >> s;
    if(s[0] != '-')
        cout << s;
    else
    {
        int n=s.size();
        for(int i=1; i<n; a[s[i]-'0']++,++i);
        if(a[1] == 1 && a[0] == n-2)
            cout << 0;
        else
            for(int i=0; i<n-2; ++i)
                cout << s[i];
        cout << min(s[n-2]-'0',s[n-1]-'0');
    }
}

#include <iostream>
#include <string>
using namespace std;
int main()
{
 int n;
 cin >> n;
 if((n>=0))
 cout << n;
 else{
     int n1= n/10;
     int n2= n/100*10+1;
     if((n1>n2))
 cout << n2;
     else
 cout << n1;
 }
 return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int64_t s;
    cin>>s;
    if (s>0)cout<<s<<endl;
    else if (s<0 && s%10==0)cout<<0<<endl;
    else cout<<s/10<<endl;
return 0;
}

#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;
typedef long long ll;
bool solve(){
	string s, min;
	cin >> s;
	if(s[0] != '-') {
		cout << s << endl;
		return true;}
	else{
		s.erase(0, 1);
		for(int i = 0;i < s.size();i++){
			string ss = s.substr(i, 1);
			s.erase(i, 1);
			if(s < min || !i) min = s;
			s.insert(i, ss);
		}
	}
	if(s != "0") cout << '-' << min << endl;
	else cout << '0' << endl;
	return true;
}

int main(){
#ifndef ONLINE_JUDGE
	while(solve()){}
#else
	solve();
#endif
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<fstream>
#include<sstream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
using namespace std;

int main()
{
	string s;
	cin>>s;
	int l=s.length();
	if(s[0]=='-')
	{
		if(s[l-1]>s[l-2])
			s[l-1]='\0';
		else
		{
			s[l-2]=s[l-1];
			s[l-1]='\0';
		}
	}
	if(s[2]=='\0' && s[0]=='-' && s[1]=='0')
		s="0";
	else if(s[0]=='-' && s[1]=='\0')
		s="0";
	cout<<s<<"\n";

	return 0;
}

#include <iostream>
using namespace std;
int main ()
{int n;
cin>>n;
switch (n>0)
{
case 1:
cout << n;
break;
case 0:
if ((n/10)>(n/100))
         cout<<n/10;
         else if ((n/100)>(n/10))
           cout<<n/100;
           else
           cout<<n;
           break;

}
           return 0;
}

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

int main()
{
    int i,j,n;
    cin>>n;

    if(n>=0)
    {
        cout<<n;
        return 0;
    }

    int x,y,q;

    x = abs(n%10);

    n =n/10;

    y = abs(n%10);

    n = n/10;

    if(n<-9)
    cout<<n;

    if(x>y)
    cout<<y;
    else
        cout<<x;
}

#include <iostream>

using namespace std;
int main() {
  int n;
  cin>>n;
  if(n>=0) cout<<n;
  else {
    int n1=n%10;
    int n2=(n/100)*10+n%10;
    if(n2>=n1) cout<<n2;
    else cout<<n1;
  }//*

  return 0;
}

#include <iostream>
#include <sstream>
using namespace std;
int main(){
    long long n,tot,min,a,b,check,data[12];
    string in,temp;
    in="-1234";
    in="-100003";
    cin>>in;
    stringstream buffer(in);
    buffer>>n;
    //cout<<in<<"  " <<in.size()<<endl;
    if (n>=0)
        cout<<n;
    else{
            /*
        check=0;
        for (a=1;a<in.size();a++){
            temp="";
            for (b=1;b<in.size();b++){
                if (a!=b){
                    temp=temp+in[b];
                    //cout<<temp<<"    "<<b<<"  "<<a<<"   "<<in[b]<<endl;
                }
            }
            if (n<-100 && (int)temp[2]==48 && a==1) check=1;
            stringstream buffer(temp);
            buffer>>tot;
            data[a]=tot;
            //cout<<data[a]<<"   "<<a<<endl;
        }
        //cout<<endl<<endl;
        min=data[1+check];
        for (a=2+check;a<in.size();a++){
            if (data[a]<min) min=data[a];
        }
        */
        if (n<-100){

            for (a=1;a<=2;a++){
                temp="";
                for (b=1;b<in.size();b++){
                    if (in.size()-a!=b){
                        temp=temp+in[b];
                    }
                }
                stringstream buffer(temp);
                buffer>>data[a];
            }
            if (data[1]<data[2])
                cout<<-data[1];
            else
                cout<<-data[2];
        }
        else{
            temp=in.substr(2,in.size()-1);
            stringstream buffer(temp);
            buffer>>tot;
            cout<<-tot;
        }

    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,n;
    cin>>n;
    if(n>0)
        cout<<n;
    else
    {
        int x,y;
        x=n%10;
        y=(n/10)%10;
        if(abs(x)>abs(y))
            cout<<n/10;
        else
            cout<<y*10-n;
    }
    return 0;

}

#include<bits/stdc++.h>
#define lli long long int
#define mod 1000000007
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    lli i,r,c=0,j,k,t,f=0,q,n,l,f1=0,y,m,d;
    string s,s1,s2;
    cin>>n;
    if(n>=0)
        cout<<n;
    else
        cout<<n/10;

}

#include <bits/stdc++.h>

#define ll long long
#define v vector
#define p pair
#define f first
#define s second
#define pb push_back

using namespace std;

int main()
{
	ll n; cin >> n;
	if(n >= 0) cout << n << endl;
	else {
		string s = to_string(n);
		if(s[2] != '0') s.erase(s.begin(), s.begin() + 2);
		else {
			char c;
			for(int i = 1; i < s.length(); i++) {
				if(c - '0' < s[i] - '0') c = s[i];
			}
			s.erase(s.find(c));
		}
		cout << s << endl;
	}
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	vector<long long> v;
	long long n,i,t,o;
	cin>>n;
	if(n>=0)
	{
		cout<<n;
		return 0;
	}
	else if(n==-10 || n==-20 || n==-30 || n==-40 || n==-50 || n==-60 || n==-70 || n==-80 || n==-90)
	{
		cout<<0;
		return 0;
	}
	else
	{
		long long x=abs(n);
		while(x>0)
		{
			t=x%10;
			v.push_back(t);
			x/=10;
		}
		long long mx=max(v[0],v[1]);
		cout<<"-";
		for(i=v.size()-1;i>=0;i--)
		{
			if(v[i]==mx)
			{
				if(i!=0 && i!=1)	cout<<v[i];
			}
			if(v[i]!=mx)
			{
				cout<<v[i];
			}
		}
	}
	return 0;

}

#include<cstdio>
main(){
long long i,j,k,l,m,n;
while(scanf("%lld",&n)==1){ i=0;j=0;k=0;l=0;
    if(n>=0) printf("%lld\n",n);
    else{    l=(n/100);
            i=n%100;
            j=n%10;
            k=i/10;
            if(j<k) printf("%lld%lld\n",l,k);
         else
          if(j==0)
         printf("%lld\n",l);
         else { j=j*(-1); printf("%lld%lld\n",l,j);}
    }

}return 0;

}

#include <iostream>
using namespace std;

int main(){
    int n;
    cin>>n;

    if (n>=0)
        cout<<n;
    else
    {
        if(n%10>n/10%10)
            cout<<n%10;
        else
            cout<<(n%10)+(n/100*10);
    }
    return 0;
}

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

long long a,r[100000],b,k,s,c,t,j,v,u,o,i,l,n,w,h[100000],d,m[1000000];
pair <long long, long long> x[11111];
string q,p;
char e;

int main() {

	cin >> p;

	if ( p[0]!='-'){
		cout << p;
		return 0;
	}

	if (p.size()==3 && p[2]=='0'){
	    cout << 0;
	    return 0;
	}
	for (i=0;i<p.size();i++){
	    a=p[i];
	    v=max(v,a);
	}
	for (i=0;i<p.size();i++){
	    if(p[i]!=a && u==0){
	        cout <<p[i];
	    }
	    else u=1;

	}

}

#include<iostream>
#include<math.h>
#include<vector>
using namespace std;

int main()
{
	long long num;
	cin >> num;
	if (num >= 0)
		cout << num << endl;
	else
	{
		long long first_digit = num / 10;
		long long second_digit = ((long long)num / 100) + num % 10;
		if (first_digit == 0 || second_digit == 0)
		{
			cout << 0 << endl;
			return 0;
		}
		cout << fmin(first_digit, second_digit) << endl;
	}
}

#include <bits/stdc++.h>

using namespace std;

int main(){
	long long int n;
	cin>>n;
	long long int a=n;
	if(n>=0){
		cout<<n;
	}
	else{
		int max=0;
		int r;
		while(n*-1>0){
		   r=n%10;
		   if(r<max) max=r;
		   n=n/10;
		}
		long long int sum=0;
		long long int i=1;
		while(a*-1>0){
           r=a%10;
           if(r==max) r=0; max=1;
           sum=sum+(r*i);
           a=a/10;
           i=i*10;
       }
       cout<<sum/10;
    }
}