#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, p;
  bool operator<(const node& _) const { return x < _.x; }
} A[200005];
int R[200005];
int main() {
  int d, n, m;
  scanf("%d%d%d", &d, &n, &m);
  for (int i = (1), i_END = (m); i <= i_END; i++)
    scanf("%d%d", &A[i].x, &A[i].p);
  sort(A + 1, A + m + 1);
  A[++m] = (node){d, 0};
  R[m] = m;
  for (int i = (m - 1), i_END = (1); i >= i_END; i--) {
    int now = i;
    while (A[now + 1].p > A[i].p && now + 1 <= m) now = R[now + 1];
    R[i] = now;
  }
  for (int i = (1), i_END = (m); i <= i_END; i++) R[i] = min(m, R[i] + 1);
  long long ans = 0;
  int now = n, pos = 0;
  for (int i = (1), i_END = (m); i <= i_END; i++) {
    int nxt = R[i];
    now -= (A[i].x - pos);
    if (now < 0) {
      puts("-1");
      return 0;
    }
    if (i == m) break;
    pos = A[i].x;
    if ((A[nxt].x - A[i].x) > now) {
      if (A[nxt].x - A[i].x > n) {
        ans += 1ll * (n - now) * A[i].p;
        now = n;
      } else {
        ans += 1ll * ((A[nxt].x - A[i].x) - now) * A[i].p;
        now = A[nxt].x - A[i].x;
        now -= A[nxt - 1].x - A[i].x;
        i = nxt - 1;
        pos = A[nxt - 1].x;
      }
    } else {
      now -= (A[nxt - 1].x - A[i].x);
      i = nxt - 1;
      pos = A[i].x;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
