#include <bits/stdc++.h>
using namespace std;
inline int IN() {
  int x = 0, ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void Out(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10)
    Out(x / 10), putchar(x % 10 + '0');
  else
    putchar(x + '0');
}
const int M = 200005;
struct Stat {
  int x, p;
  bool operator<(const Stat& w) const { return x < w.x; }
} a[M];
int d, n, m, sml[M];
int main() {
  d = IN(), n = IN(), m = IN();
  for (int i = 1; i <= m; i++) a[i].x = IN(), a[i].p = IN();
  a[0].x = 0;
  a[m + 1].x = d;
  a[m + 1].p = 0;
  sort(a + 1, a + m + 1);
  sml[m] = m + 1;
  for (int i = m - 1; i >= 1; i--) {
    int now = i + 1;
    while (a[now].p > a[i].p) now = sml[now];
    sml[i] = now;
  }
  long long Ans = 0, gas = n;
  for (int i = 1; i <= m + 1; i++) {
    gas -= a[i].x - a[i - 1].x;
    if (gas < 0) return puts("-1"), 0;
    int Min = min(n, a[sml[i]].x - a[i].x);
    if (gas < Min) {
      Ans += 1ll * (Min - gas) * a[i].p;
      gas = Min;
    }
  }
  printf("%I64d\n", Ans);
}
