#include <bits/stdc++.h>
using namespace std;
inline int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
template <typename T>
inline bool smax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool smin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline T pw(T a, long long b) {
  T c = 1;
  while (b) {
    if (b & 1) c = (c * a);
    a = a * a;
    b >>= 1;
  }
  return c;
}
long long n, m, d;
const int maxn = 200010;
int pos[maxn], price[maxn];
int main() {
  d = ri(), m = ri(), n = ri();
  for (int i = 0; i < (n); i++) scanf("%d %d", pos + i + 1, price + i + 1);
  vector<pair<int, int> > v;
  for (int i = 0; i < (n); i++)
    v.push_back(pair<int, int>(pos[i + 1], price[i + 1]));
  sort(v.begin(), v.end());
  for (int i = 0; i < (n); i++)
    pos[i + 1] = v[i].first, price[i + 1] = v[i].second;
  pos[n + 1] = d;
  set<pair<int, int> > s;
  long long last = 0, rem = m;
  long long res = 0, maxi = m;
  for (int i = (1); i < (n + 2); i++) {
    if (maxi < pos[i] - pos[i - 1]) {
      cout << -1 << endl;
      return 0;
    }
    if (m >= pos[i] - pos[i - 1]) {
      m -= pos[i] - pos[i - 1];
    } else {
      long long need = pos[i] - pos[i - 1] - m;
      while (need && !s.empty()) {
        auto x = s.begin();
        if (x->second == last) {
          if (maxi - rem > need) {
            res += x->first * need;
            rem += need;
            need = 0;
          } else {
            need -= maxi - rem;
            res += x->first * (maxi - rem);
            rem = maxi - (pos[last + 1] - pos[last]);
            last++;
            s.erase(x);
          }
        } else {
          for (int j = (last); j < (x->second); j++)
            s.erase(pair<int, int>(price[j], j));
          rem -= pos[x->second] - pos[last];
          last = x->second;
        }
      }
      m = 0;
    }
    s.insert(pair<int, int>(price[i], i));
  }
  cout << res << endl;
  return 0;
}
