#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 5;
int d, n, m;
int nxt[M];
struct node {
  int x, cost;
  bool operator<(const node &tmp) const { return x < tmp.x; }
} A[M];
void init() {
  nxt[m - 1] = m;
  for (int i = m - 2; i >= 1; i--) {
    if (A[i].cost > A[i + 1].cost)
      nxt[i] = i + 1;
    else {
      int now = i + 1;
      while (A[nxt[now]].cost > A[i].cost) now = nxt[now];
      nxt[i] = nxt[now];
    }
  }
}
int main() {
  scanf("%d %d %d", &d, &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &A[i].x, &A[i].cost);
  }
  if (A[m].x < d) {
    A[++m].x = d;
    A[m].cost = 0;
  }
  sort(A + 1, A + 1 + m);
  init();
  int oil = n;
  long long ans = 0;
  for (int i = 1; i <= m; i++) {
    oil -= A[i].x - A[i - 1].x;
    if (oil < 0 || i == m) break;
    int pos = nxt[i];
    if (A[pos].x - A[i].x > oil) {
      if (A[pos].x - A[i].x <= n) {
        ans += 1ll * A[i].cost * (A[pos].x - A[i].x - oil);
        oil = A[pos].x - A[i].x;
      } else {
        ans += 1ll * A[i].cost * (n - oil);
        oil = n;
      }
    }
  }
  if (oil < 0)
    printf("-1\n");
  else
    printf("%I64d\n", ans);
  return 0;
}
