// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
#define ll long long int
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define forn(i, s, n)  for(ll i=(ll)s; i<(ll)(n); i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define pll pair<long long int, long long int>
#define pii pair<int, int>
#define pss pair<string, string>
#define ull unsigned long long int
#define lld long double
#define F first
#define S second
#define PI 3.141592653589793238
#define prec(n) fixed<<setprecision(n)
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define itsval(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); itval(_it, args); }
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

void itval(istream_iterator<string> it) {}
template<typename T, typename... Args>
void itval(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    itval(++it, args...);
}
const ll MOD = 1e9 + 7;
template <typename T>
inline void print(T x) {cout << x << "\n";}
template <typename T>
inline void printvec(T x) {for (auto a : x)cout << a << ' '; cout << '\n';}
// -----------------------------------------------------------------------

struct custom {
    bool operator()(const pll &p1, const pll &p2)const {
        return p1.F > p2.F;
    }
};

// Calculate a^b % MOD -------------------------------------------------
ll get_pow(ll a, ll b, ll M = MOD) {
    ll res = 1;
    while (b) {
        if (b & 1) res = (res * a) % M;
        a = (a * a) % M;
        b >>= 1;
    }
    return res;
}
// ---------------------------------------------------------------------
const ll N = 2e5 + 5, inf = 4e18;
ll dp[N][2];
void solve()
{
    ll n;
    cin >> n;
    vll mx(n + 1, -inf), mi(n + 1, inf);
    ll x, c;
    forn(i, 0, n)
    {
        cin >> x >> c;
        c--;
        mi[c] = min(mi[c], x);
        mx[c] = max(mx[c], x);
    }
    mx[n] = mi[n] = 0;
    ll ans = 0, p = 0;
    
    for (int j = n - 1; j >= 0; j--)
    {
        // dono mi
        if (mi[j] == inf)
        {
            dp[j][0] = dp[j + 1][0];
            dp[j][1] = dp[j + 1][1];
            mx[j] = mx[j + 1];
            mi[j] = mi[j + 1];
            continue;
        }
        dp[j][0] = abs(mi[j + 1] - mx[j]) + mx[j] - mi[j] + dp[j + 1][0];
        dp[j][0] = min(dp[j][0], abs(mx[j + 1] - mx[j]) + mx[j] - mi[j] + dp[j + 1][1]);
        dp[j][1] = abs(mx[j + 1] - mi[j]) + mx[j] - mi[j] + dp[j + 1][1];
        dp[j][1] = min(dp[j][1], abs(mi[j + 1] - mi[j]) + mx[j] - mi[j] + dp[j + 1][0]);
    }
    ans = min(dp[0][0] + abs(mi[0]), dp[0][1] + abs(mx[0]));
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int test = 1;
    clock_t z = clock();
    // cin >> test;

    forn(tes, 0, test)
    {
        solve();
    }
    debug("Total Time:%.4f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
    return 0;
}
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <chrono>
#include <functional>
#define _crt_secure_no_warnings
#define JH ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define mp make_pair
#define INF 0x3F3F3F3F
#define MAXLL 1000000000000000000LL
#define MOD ll(1e9 + 7)
#define LOGMAX 21
#define ALPHABET 2
#define loop(i, n) for (int i = 1; i <= (n); i++)
#define loop0(i, n) for (int i = 0; i < (n); i++)
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define all1(v) v.begin() + 1, v.end()
#define F first
#define S second
#define EPS 1e-9
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
typedef pair<ll, ll> llll;
typedef pair<int, int> ii;
typedef unordered_map<int, int> umii;
typedef unordered_map<ll, ll> umll;
typedef unordered_set<int> usi;
typedef unordered_multiset<int> usmi;
//main exec


int main(){
    JH
    lld a, b; cin >> a >> b;
    cout << fixed << setprecision(9) << (b / 100) * a << endl;
}