#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const double PI = acos(-1.0);
const int MAXN = 2e5 + 5;
const int MAXM = 2e6 + 5;
const int MOD = 1e9 + 7;
int sgn(double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0)
    return -1;
  else
    return 1;
}
long long pw(long long a, long long n, long long mod) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = ret * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ret;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
void inc(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
void dec(long long &a, long long b) {
  a -= b;
  if (a < 0) a += MOD;
}
int mul(int a, int b) {
  long long c = 1ll * a * b;
  return c - c / MOD * MOD;
}
int d, n, m;
long long ans;
int h, t;
pair<int, int> a[MAXN], q[MAXM];
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i < m + 1; i++) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a + 1, a + 1 + m);
  ans = h = t = 0;
  q[t++] = make_pair(n, 0);
  for (int i = 1; i < m + 1; i++) {
    int dis = a[i].first - a[i - 1].first;
    if (dis > n) {
      ans = -1;
      break;
    }
    while (h < t) {
      if (q[h].first > dis) {
        q[h].first -= dis;
        break;
      } else {
        dis -= q[h].first;
        h++;
      }
    }
    dis = a[i].first - a[i - 1].first;
    while (h < t) {
      if (q[t - 1].second >= a[i].second) {
        ans -= 1ll * q[t - 1].first * q[t - 1].second;
        dis += q[t - 1].first;
        t--;
      } else
        break;
    }
    ans += 1ll * dis * a[i].second;
    q[t++] = make_pair(dis, a[i].second);
  }
  if (ans != -1) {
    if (d - a[m].first > n)
      ans = -1;
    else {
      int dis = d - a[m].first;
      while (h < t) {
        if (q[h].first > dis) {
          q[h].first -= dis;
          break;
        } else {
          dis -= q[h].first;
          h++;
        }
      }
      while (h < t) {
        ans -= 1ll * q[h].first * q[h].second;
        h++;
      }
    }
  }
  printf("%lld\n", ans);
}
