#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <class T1, class T2>
inline void remin(T1& a, T2 b) {
  a = min(a, (T1)b);
}
const int maxN = 1 << 18, maxTS = maxN * 2, INF = 1 << 30;
struct Tree {
  int offset, qbegin, qend, root, val;
  pair<int, int> T[maxTS], res;
  void qpriv(int v, int left, int right) {
    if (left >= qend or right <= qbegin) return;
    if (left >= qbegin and right <= qend) {
      remin(res, T[v]);
      return;
    }
    qpriv(v * 2, left, (left + right) / 2);
    qpriv(v * 2 + 1, (left + right) / 2, right);
  }
  void firstpriv(int v, int left, int right) {
    if (left >= qend or right <= qbegin) return;
    if (left >= qbegin and right <= qend) {
      if (root == 0 and T[v].first < val) root = v;
      return;
    }
    firstpriv(v * 2, left, (left + right) / 2);
    firstpriv(v * 2 + 1, (left + right) / 2, right);
  }
  void init(int n, pair<int, int>* t) {
    for (offset = 1; offset < n; offset *= 2)
      ;
    for (int i = (0); i < (offset); i++)
      T[offset + i] = {i < n ? t[i].second : INF, i};
    for (int i = (offset - 1); i > (0); i--) T[i] = min(T[i * 2], T[i * 2 + 1]);
  }
  pair<int, int> mn(int a, int b) {
    qbegin = a + offset;
    qend = b + offset;
    res = {INF, INF};
    qpriv(1, offset, offset * 2);
    return res;
  }
  int firstLower(int a, int b, int c) {
    qbegin = a + offset;
    qend = b + offset;
    val = c;
    root = 0;
    firstpriv(1, offset, offset * 2);
    assert(root != 0);
    int v;
    for (v = root; v < offset;) v = T[v * 2].first < val ? v * 2 : v * 2 + 1;
    return T[v].second;
  }
} tree;
pair<int, int> T[maxN];
void solve() {
  int d, vol, n;
  scanf("%d%d%d", &d, &vol, &n);
  T[0] = {0, 0};
  T[n + 1] = {d, 0};
  for (int i = (1); i < (n + 1); i++) scanf("%d%d", &T[i].first, &T[i].second);
  sort(T, T + n + 1);
  for (int i = (0); i < (n + 1); i++)
    if (T[i + 1].first - T[i].first > vol) {
      printf("-1\n");
      return;
    }
  tree.init(n + 2, T);
  long long res = 0, fuel = vol, i = 0;
  while (i <= n) {
    int j = upper_bound(T, T + n + 2, make_pair(T[i].first + vol, INF)) - T;
    auto p = tree.mn(i + 1, j);
    if (p.first >= T[i].second) {
      j = p.second;
      res += 1ll * T[i].second * (vol - fuel);
      fuel = vol;
    } else {
      j = tree.firstLower(i + 1, j, T[i].second);
      long long df = max(0ll, T[j].first - T[i].first - fuel);
      fuel += df;
      res += 1ll * T[i].second * df;
    }
    fuel -= T[j].first - T[i].first;
    i = j;
  }
  printf("%lld\n", res);
}
int main() {
  int t = 1;
  for (int tid = (1); tid < (t + 1); tid++) {
    solve();
  }
  return 0;
}
