#include <bits/stdc++.h>
using namespace std;
int n, m;
struct node {
  int x, v;
  bool operator<(const node &ano) const { return x < ano.x; }
} A[200010];
int q[200010], C[200010];
int halt() {
  printf("-1\n");
  exit(0);
}
int main() {
  int d;
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &A[i].x, &A[i].v);
  }
  sort(A + 1, A + m + 1);
  int first = 1, last = 0;
  q[++last] = 0;
  C[last] = n;
  long long ans = 0;
  A[m + 1].x = d;
  for (int i = 1; i <= m + 1; ++i) {
    for (int d = A[i].x - A[i - 1].x;; ++first) {
      if (first > last) halt();
      int a = min(d, C[first]);
      d -= a, C[first] -= a;
      if (C[first]) break;
      if (!d) break;
    }
    if (i == m + 1) {
      for (; first <= last; --last) ans -= (long long)q[last] * C[last];
      ;
      break;
    }
    int t = A[i].x - A[i - 1].x;
    for (; first <= last && A[i].v <= q[last]; t += C[last], --last)
      ans -= (long long)q[last] * C[last];
    q[++last] = A[i].v;
    C[last] = t;
    ans += (long long)q[last] * C[last];
  }
  printf("%I64d\n", ans);
  return 0;
}
