#include <bits/stdc++.h>
using namespace std;
pair<int, int> vec[200005];
set<pair<int, int> > remainingGas;
set<pair<int, int> >::iterator it;
int main() {
  int n, d, m, xi, pi;
  scanf("%d %d %d", &d, &n, &m);
  for (int contador = 0; contador < m; contador++) {
    scanf("%d %d", &xi, &pi);
    vec[contador] = pair<int, int>(xi, pi);
  }
  sort(vec, vec + m);
  int myp = 0, index = 0;
  vec[m] = pair<int, int>(d, 0);
  long long custo = 0;
  remainingGas.insert(pair<int, int>(0, n));
  int capacity = n;
  while (index <= m) {
    int spent = vec[index].first - myp;
    if (spent > capacity) {
      printf("-1\n");
      return 0;
    }
    capacity -= spent;
    while (spent > 0) {
      it = remainingGas.begin();
      pair<int, int> rem = *it;
      remainingGas.erase(it);
      if (spent > rem.second) {
        spent -= rem.second;
      } else {
        rem.second -= spent;
        spent = 0;
        remainingGas.insert(rem);
      }
    }
    custo += (long long)vec[index].second * n;
    remainingGas.insert(pair<int, int>(vec[index].second, n));
    while (capacity > 0) {
      it = remainingGas.end();
      it--;
      pair<int, int> rem = *it;
      remainingGas.erase(it);
      if (capacity > rem.second) {
        capacity -= rem.second;
        custo -= (long long)rem.first * rem.second;
      } else {
        rem.second -= capacity;
        custo -= (long long)rem.first * capacity;
        capacity = 0;
        remainingGas.insert(rem);
      }
    }
    capacity = n;
    myp = vec[index].first;
    index++;
  }
  printf("%I64d\n", custo);
  return 0;
}
