#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vchar = vector<char>;
using vvchar = vector<vchar>;
using vp = vector<P>;
using vpp = vector<pair<P, P>>;
using vvp = vector<vp>;

#define rep(i, n) for (int i = 0; i < n; ++i)
#pragma region Debug
istream &operator>>(istream &is, P &a)
{
    return is >> a.first >> a.second;
}
ostream &operator<<(ostream &os, const P &a) { return os << "(" << a.first << "," << a.second << ")"; }

template <typename T>
void view(const std::vector<T> &v)
{
    for (const auto &e : v)
    {
        std::cout << e << " ";
    }
    std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T>> &vv)
{
    for (const auto &v : vv)
    {
        view(v);
    }
}
#pragma endregion

int main()
{
    int n;
    cin >> n;
    ll keta = 0;
    ll sum = 0;
    rep(i, n)
    {
        ll a, b;
        cin >> a >> b;
        sum += a * b;
        keta += b;
    }
    ll total = (sum - 1) / 9;

    ll ans = keta - 1 + total;

    cout << ans << endl;

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
int fact(int n){
    if(n == 1) return 1;
    else return n * fact(n-1);
}

int main(){
    int n;
    cin >> n;
    vector<pair<int,int>> array(n);
    for(int i=0;i<n;i++) cin >> array.at(i).first >> array.at(i).second;
    sort(array.begin(),array.end());
    double sum = 0;
    do{
        for(int i=0;i<n-1;i++){
            int d2 = (array.at(i+1).first - array.at(i).first) * (array.at(i+1).first - array.at(i).first) +
                    (array.at(i+1).second - array.at(i).second) * (array.at(i+1).second - array.at(i).second);
            double d = sqrt((double)d2);
            sum += d;
        }
    } while(next_permutation(array.begin(),array.end()));

    int kaijou = fact(n);
    double ave = sum / (double)kaijou;
    printf("%.10lf \n",ave);
}
