#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e9 + 100;
const int N = 200200;
long long m, mm, d;
pair<long long, long long> a[N];
long long distToNxt[N];
pair<long long, long long> st[N];
int sz;
int n;
int main() {
  scanf("%lld%lld%d", &d, &m, &n);
  mm = m;
  for (int i = 0; i < n; i++) scanf("%lld%lld", &a[i].first, &a[i].second);
  sort(a, a + n);
  a[n++] = make_pair(d, 0);
  sz = 0;
  st[sz++] = a[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    while (sz > 0 && st[sz - 1].second >= a[i].second) sz--;
    if (sz == 0) throw;
    distToNxt[i] = st[sz - 1].first - a[i].first;
    st[sz++] = a[i];
  }
  long long ans = 0;
  long long x = 0;
  for (int i = 0; i < n; i++) {
    long long t = a[i].first - x;
    x = a[i].first;
    if (t > m) {
      printf("-1\n");
      return 0;
    }
    m -= t;
    if (i == n - 1) break;
    if (m < distToNxt[i]) {
      long long add = min(mm, distToNxt[i]) - m;
      m += add;
      ans += add * a[i].second;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
