#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000001;
const long long int LLINF = 1000000000000000001LL;
struct MinTree {
  vector<pair<int, int> > T;
  int p = 1;
  int par(int x) { return (x - 1) / 2; }
  MinTree(vector<int> &V) {
    int n = (int)(V).size();
    while (p < n) p *= 2;
    T.resize(2 * p - 1);
    for (int i = (0); i <= (n - 1); ++i) {
      T[i + p - 1] = {V[i], i};
    }
    for (int i = (p - 2); i >= (0); --i) {
      T[i] = min(T[2 * i + 1], T[2 * i + 2]);
    }
  }
  int MinPos(int l, int r) {
    l += p - 1;
    r += p - 1;
    pair<int, int> ans = min(T[l], T[r]);
    while (par(l) != par(r)) {
      if (l % 2 == 1) ans = min(ans, T[l + 1]);
      if (r % 2 == 0) ans = min(ans, T[r - 1]);
      l = par(l);
      r = par(r);
    }
    return ans.second;
  }
};
pair<long long int, long long int> solve(int l, int r, MinTree &tree,
                                         vector<pair<int, int> > &T,
                                         long long int n, long long int d) {
  if (r <= l) {
    return {0, n};
  }
  long long int dist = T[r].first - T[l].first;
  if (dist <= n) {
    return {0, n - dist};
  } else if (r == l + 1) {
    return {-1, -1};
  } else {
    int pos = tree.MinPos(l + 1, r - 1);
    auto ansL = solve(l, pos, tree, T, n, d),
         ansR = solve(pos, r, tree, T, n, d);
    if (ansL.first == -1 || ansR.first == -1) {
      return {-1, -1};
    }
    long long int rDist = T[r].first - T[pos].first;
    long long int needToHave = min(rDist, n);
    long long int needToBuy = max(0LL, needToHave - ansL.second);
    long long int ans = ansL.first + ansR.first + needToBuy * T[pos].second;
    return {ans, ansR.second - (n - needToHave)};
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  int d, n, m;
  cin >> d >> n >> m;
  vector<pair<int, int> > T(m);
  for (int i = (0); i <= (m - 1); ++i) cin >> T[i].first >> T[i].second;
  T.push_back({0, INF});
  T.push_back({d, INF});
  vector<int> price(m + 2);
  sort(T.begin(), T.end());
  for (int i = (0); i <= (m + 1); ++i) price[i] = T[i].second;
  MinTree tree(price);
  cout << solve(0, m + 1, tree, T, n, d).first;
  return 0;
}
