#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 20;
struct h {
  long long w, p;
} z[N];
inline bool mycmp(h p, h q) { return p.w < q.w; }
long long top, s[N], nx[N];
long long n, m, d;
signed main() {
  scanf("%lld%lld%lld", &d, &n, &m);
  for (long long i = 1; i <= m; i++) scanf("%lld%lld", &z[i].w, &z[i].p);
  z[++m].w = d;
  sort(z + 1, z + m + 1, mycmp);
  for (long long i = m; i >= 1; i--) {
    while (top && z[s[top]].p > z[i].p) top--;
    s[++top] = i;
    nx[i] = s[top - 1];
  }
  long long now = n, ls = 0, ans = 0;
  for (long long i = 1; i <= m; i++) {
    long long w = z[i].w;
    if (now + ls < w) {
      puts("-1");
      return 0;
    } else {
      now -= w - ls;
      ls = w;
      if (n + ls >= z[nx[i]].w) {
        if (now + ls < z[nx[i]].w) {
          ans += (z[nx[i]].w - ls - now) * z[i].p;
          now = (z[nx[i]].w - ls);
        }
      } else {
        ans += (n - now) * z[i].p;
        now = n;
      }
    }
  }
  printf("%lld", ans);
}
