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

#define ll              long long int
#define scan(any)       for(auto &i:any) cin>>i;
#define print(any)      for(auto i:any) cout<<i<<" "; 
#define endl            '\n'
#define pb              push_back
#define vll             vector<ll> 
#define f(i,x,y)        for(i=x;i<y;i++)
#define INF             LLONG_MAX
#define s(x)            sort(x.begin(),x.end())
#define all(v)          v.begin(),v.end()
#define p2(n,x)         cout << fixed << setprecision(x) <<n<<endl; 
#define pll             pair<ll,ll> 
#define mll             map<ll,ll>
#define ff              first
#define ss              second
#define blt(x)          __builtin_popcount(x)

void solve()
{
    long  double n;
    cin>>n;
    long  double ans=n;
    long double i;
    f(i,2,n)
    {
        ans+=(n/i);
    }
    p2(ans,10);    
}

int main()
{
    

    ios::sync_with_stdio(0);
    cin.tie(0);
    
    ll t = 1;
    while(t--) {
        solve();    
    }
    return 0;
}   
#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i,a,b) for(int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\n'
#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
using namespace std;
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
using lli = long long;
using vi = vc<int>;
using ii = pair<int,int>;

lli gcd(lli a, lli b){return (b?gcd(b,a%b):a);}
lli lcm(lli a, lli b){ if(!a || !b) return 0; return a * b / gcd(a, b); }
int popcount(lli x) { return __builtin_popcountll(x); }
lli poww(lli a, lli b){
	lli res = 1;
	while(b){ if(b&1) res = res*a; a=a*a; b>>=1;}
	return res;
}


// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// int rnd(int n){return uniform_int_distribution<int>(0, n-1)(rng);}

template<class t,class u>bool mmax(t&a,u b){if(a<b)a=b;return a<b;}
template<class t,class u>bool mmin(t&a,u b){if(b<a)a=b;return b<a;}
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
// ---- しゃけ ツナマヨ ('-')7

void solve(){
	int n; cin>>n;
	int best = inf<int>,same=inf<int>;
	vi x(n),y(n);
	fore(i,0,n){
		int a,b; cin>>a>>b;
		mmin(same,a+b);
		x[i]=a;
		y[i]=b;
	}
	best = same;
	fore(i,0,n)fore(j,0,n)if(i!=j)mmin(best,max(x[i],y[j]));
	fore(i,0,n)fore(j,0,n)if(i!=j)mmin(best,max(y[i],x[j]));
	cout<<best<<ENDL;

}

int main(){_
//	int t; cin>>t; while(t--)
	solve();
}
