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

using namespace std;

using ll = long long;
using veci = vector<int>;
using vecd = vector<double>;
using vecl = vector<long long>;

bool check_slope(int x1,int y1,int x2,int y2){
    int bigx,smallx,bigy,smally;
    if(x1<x2){
        bigx=x2;
        smallx=x1;
        bigy=y2;
        smally=y1;
    }
    else{
        bigx=x1;
        smallx=x2;
        bigy=y1;
        smally=y2;
    }
    /*
    double a=(double)(bigy-smally)/(bigx-smallx);
    cout<<" "<<a;
    */
    if(bigy-smally>bigx-smallx || bigy-smally<smallx-bigx) return false;
    else return true;
}

void Main(){
    int n,ans=0;
    cin>>n;
    veci x(n),y(n);
    for(int i=0;i<n;i++) cin>>x[i]>>y[i];
    for(int i=0;i<n;i++) for(int j=i+1;j<n;j++) {
        //cout<<i<<" "<<j;
        if(check_slope(x[i],y[i],x[j],y[j])){
            ans++;
            //cout<<" ok";
        }
        //cout<<endl;
    }
    cout<<ans;
    return;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    Main();
    return 0;
}
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define ll long long 
#define FI first 
#define SE second
#define pb push_back 
#define eb emplace_back
#define mod 1000000007
#define all(c) (c).begin(),(c).end()
#define LB  lower_bound
#define UB  upper_bound
#define max3(a,b,c) max(c,max(a,b))
#define min3(a,b,c) min(c,min(a,b))
#define mems(s, n) memset(s, n, sizeof(s))
#define NINF -1e18
#define INF 1e18
#define int ll int
#define endl '\n'
#define double long double
#define OOK order_of_key  //no of elements strictly less than
#define FBO find_by_order //iterator pointing kth element;indexing starts from 0
#define CK3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define CK4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl

typedef pair<int,int> PII;
typedef pair<pair<int,int>,int> PPII;
typedef pair<int,pair<int,int>> PIPI;
typedef map<int,int>MII;
typedef vector<int> VI;
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

/*int power(int a, int b)
{int x=1,y=a;while(b>0){if(b%2){x =(x*y)%mod;}y =(y*y)%mod;b/=2;}return x%mod;}
*/


signed main()
{
ios::sync_with_stdio(false); cin.tie(0);
int T=1,T1=0;//cin>>T;
while(T1++<T)
{//cout<<"Case #"<<T1<<": ";
    int n;
    cin>>n;
    int ans=INF;
    for(int i=0;i<61;i++)
    {
        int x=1ll<<i;
        if(x<=n)
        {
            int z=n%x;
            int y=(n-z)/x;
            ans=min(ans,i+y+z);
        }
    }
    cout<<ans<<endl;
}


return 0;
}



