#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int inf = (1 << 30) - 1;
const long long inf64 = ((long long)1 << 62) - 1;
const long double pi = acos(-1);
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T abs(T x) {
  return x < 0 ? -x : x;
}
const int MAXN = 250 * 1000;
const int BEGIN = 0;
const int END = 1;
const int GLOBAL_END = 1000;
int x[MAXN], p[MAXN];
int d, v, n;
vector<pair<int, pair<int, int> > > ev;
set<pair<int, int> > cur_p;
int main() {
  scanf("%d%d%d", &d, &v, &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &x[i], &p[i]);
  }
  x[n] = 0;
  p[n] = 0;
  n++;
  for (int i = 0; i < n; ++i) {
    ev.push_back(make_pair(x[i], make_pair(BEGIN, i)));
    ev.push_back(make_pair(min(x[i] + v, d), make_pair(END, i)));
  }
  ev.push_back(make_pair(d, make_pair(GLOBAL_END, 0)));
  sort(ev.begin(), ev.end());
  long long ans = 0;
  for (int i = 0; i + 1 < ((int)(ev).size()); ++i) {
    if (ev[i].second.first == BEGIN) {
      cur_p.insert(make_pair(p[ev[i].second.second], ev[i].second.second));
    } else if (ev[i].second.first == END) {
      cur_p.erase(make_pair(p[ev[i].second.second], ev[i].second.second));
    }
    if (cur_p.empty() && ev[i].first < ev[i + 1].first) {
      printf("-1\n");
      return 0;
    }
    set<pair<int, int> >::iterator it = cur_p.begin();
    ans += (it->first) * ((long long)(ev[i + 1].first - ev[i].first));
  }
  cout << ans << endl;
  return 0;
}
