#include <bits/stdc++.h>
using namespace std;
 
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
//#define int long long
#include "trilib.h"
 
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<bool> vb;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<pll> vll;
 
typedef tree<pii,null_type,less<pii>,rb_tree_tag,
tree_order_statistics_node_update> oset;
 
#define fi first
#define se second
#define pb push_back
#define pf push_front
 
#define mid (l+r)/2
#define all(x) x.begin(),x.end()
#define FOR(i,a) for(int i=0;i<(a);i++)
#define FORE(i,a,b) for(int i=(a);i<(b);i++)
 
#define cont(x) for(auto el:x) cout<<el<<' ';cout<<endl;
#define contp(x) for(auto el:x) cout<<el.fi<<'-'<<el.se<<' ';cout<<endl;
#define sp <<" "<<
 
#define DEBUG(x) cout<<(#x) sp x<<endl
#define carp(a,b) (((a%MOD)*(b%MOD))%MOD)
#define topla(a,b) (((a%MOD)+(b%MOD))%MOD)
 
const ll INF=1e18;
const int MAXN=1e5+5;
const int MAXNN=2e5+5;
const int MOD=1e9+7;
vi tut[2];
int piv;
bool mm(int a,int b){
    return is_clockwise(piv,a,b);
}
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n=get_n();
    if(n==3) give_answer(3);
    else{
        FORE(i,3,n+1){
            if(is_clockwise(1,2,i)) tut[0].pb(i);
            else tut[1].pb(i);
        }
        piv=1;
        sort(all(tut[0]),mm);
        piv=2;
        sort(all(tut[1]),mm);
        tut[0].pb(1);
        tut[1].pb(2);
        for(auto el:tut[0]) tut[1].pb(el);
    
        vi vec;
        for(auto el:tut[1]){
            int sz=vec.size();
            while(vec.size()>=2 and !is_clockwise(vec[sz-2],vec[sz-1],el)){
                vec.pop_back();
                sz=vec.size();
            }
            vec.pb(el);
        }
        int cikar=vec.size();
        for(auto el:tut[1]){
            int sz=vec.size();
            while(vec.size()>=2 and !is_clockwise(vec[sz-2],vec[sz-1],el)){
                vec.pop_back();
                sz=vec.size();
            }
            vec.pb(el);
        }
        int ans=vec.size();
        ans-=cikar;
        give_answer(ans);
    }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |