#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
stack<pair<int, int> > s;
vector<pair<int, int> > v;
int nex[N];
int main() {
  int n, i, j, d, m, a, b;
  scanf("%d%d%d", &d, &n, &m);
  v.push_back(make_pair(0, 0));
  for (i = 0; i < m; ++i) scanf("%d%d", &a, &b), v.push_back(make_pair(a, b));
  sort(v.begin(), v.end());
  s.push(make_pair(d, 0));
  for (i = v.size() - 1; i >= 1; --i) {
    while (s.top().second >= v[i].second) s.pop();
    nex[i] = s.top().first;
    s.push(v[i]);
  }
  int fuel = n;
  long long ret = 0;
  v.push_back(make_pair(d, 0));
  for (i = 1; i < v.size(); ++i) {
    fuel -= v[i].first - v[i - 1].first;
    if (fuel < 0) {
      printf("-1\n");
      return 0;
    }
    if (nex[i] - v[i].first <= fuel) continue;
    ret += 1LL * min(n - fuel, nex[i] - v[i].first - fuel) * v[i].second;
    fuel += min(n - fuel, nex[i] - v[i].first - fuel);
  }
  cout << ret << endl;
}
