#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const double PI = 3.141592653589793;
const int N = 3005;
int x[N], c[N], kol[N], i, j, w, n, od[N];
long long res[N], sumaod, minn;
bool cmp(int a, int b) { return x[a] < x[b]; }
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &x[i], &c[i]);
    kol[i] = i;
  }
  sort(kol, kol + n, cmp);
  for (i = 0; i < n - 1; i++) od[i] = x[kol[i + 1]] - x[kol[i]];
  res[kol[0]] = c[kol[0]];
  for (i = 1; i < n; i++) {
    w = kol[i];
    minn = res[kol[i - 1]] + c[w];
    sumaod = 0;
    for (j = i - 1; j > 0; j--) {
      sumaod += od[j] * 1LL * (i - j);
      minn = min(minn, sumaod + c[kol[j]] + res[kol[j - 1]]);
    }
    sumaod += od[0] * 1LL * i;
    minn = min(minn, sumaod + c[kol[0]]);
    res[w] = minn;
  }
  printf("%lld\n", res[kol[n - 1]]);
  return 0;
}
