#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
int d, n, m;
pair<int, int> a[MAXN];
deque<pair<int, int> > t;
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &a[i].first, &a[i].second);
  }
  a[0].first = d;
  sort(a, a + m + 1);
  t.push_back(make_pair(0, n));
  long long money = 0;
  int curpos = 0;
  int capacity = 0;
  for (int i = 0; i <= m; ++i) {
    int x = a[i].first;
    int p = a[i].second;
    int delta = x - curpos;
    capacity = delta;
    while (delta > 0) {
      if (t.empty()) {
        puts("-1");
        return 0;
      }
      int &amount = t.front().second;
      if (amount > delta) {
        amount -= delta;
        money += t.front().first * 1ll * delta;
        delta = 0;
      } else {
        money += t.front().first * 1ll * amount;
        delta -= amount;
        t.pop_front();
      }
    }
    while (!t.empty() && t.back().first > p) {
      int tmp = min(n - capacity, t.back().second);
      if (tmp >= t.back().second) {
        t.pop_back();
      } else {
        t.back().second -= tmp;
        break;
      }
      capacity += tmp;
    }
    t.push_back(make_pair(p, capacity));
    curpos = x;
  }
  printf("%lld\n", money);
  return 0;
}
