#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int inf = 50000000;
const int maxn = 200010;
deque<pair<long long, long long> > dq;
long long n, d, m;
pair<long long, long long> gas[maxn];
int main() {
  int i, j;
  long long dist, fuel;
  pair<long long, long long> temp;
  long long cost = 0;
  scanf("%lld%lld%lld", &d, &n, &m);
  for (i = 1; i <= m; i++) scanf("%lld%lld", &gas[i].first, &gas[i].second);
  sort(gas + 1, gas + m + 1);
  gas[0] = make_pair(0, 0);
  gas[m + 1] = make_pair(d, 0);
  dq.push_back(make_pair(n, 0));
  for (i = 1; i <= m + 1; i++) {
    dist = gas[i].first - gas[i - 1].first;
    fuel = n - dist;
    while (dist) {
      if (dq.empty()) {
        printf("-1\n");
        return 0;
      }
      temp = dq.front();
      dq.pop_front();
      if (temp.first > dist) {
        cost += (dist * temp.second);
        dq.push_front(make_pair(temp.first - dist, temp.second));
        break;
      } else {
        cost += (temp.second * temp.first);
        dist -= temp.first;
      }
    }
    while (!dq.empty()) {
      temp = dq.back();
      if (temp.second > gas[i].second) {
        dq.pop_back();
        fuel -= temp.first;
      } else
        break;
    }
    dq.push_back(make_pair(min(n, n - fuel), gas[i].second));
  }
  printf("%lld\n", cost);
  return 0;
}
