#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int INF = 1 << 30;
int st[maxn], r[maxn];
pair<int, int> p[maxn];
long long solve(int m, int n) {
  long long ret = 0;
  int gas = n, now = 0;
  while (now < m) {
    int nxt = r[now];
    if (p[nxt].first - p[now].first > n) return -1;
    int tmp = p[nxt].second <= p[now].second ? p[nxt].first - p[now].first : n;
    if (gas < tmp) {
      ret += 1LL * p[now].second * (tmp - gas);
      gas = tmp;
    }
    gas -= p[nxt].first - p[now].first;
    now = nxt;
  }
  return ret;
}
int main() {
  int d, n, m;
  while (~scanf("%d%d%d", &d, &n, &m)) {
    p[0] = pair<int, int>(0, INF);
    ++m;
    for (int i = 1; i < m; ++i) scanf("%d%d", &p[i].first, &p[i].second);
    p[m] = pair<int, int>(d, 0);
    sort(p, p + m + 1);
    int top = 0;
    st[top++] = m;
    for (int i = m - 1; i >= 0; --i) {
      while (top && (p[st[top - 1]].second > p[i].second ||
                     p[st[top - 1]].first - p[i].first > n))
        --top;
      r[i] = top ? st[top - 1] : i + 1;
      st[top++] = i;
    }
    printf("%I64d\n", solve(m, n));
  }
  return 0;
}
