#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << "{";
  for (const T &a : v) out << a << ", ";
  out << "}";
  return out;
}
template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p) {
  out << "(" << p.first << ", " << p.second << ")";
  return out;
}
const int dx[] = {0, 0, -1, 1};
const int dy[] = {-1, 1, 0, 0};
int d, tot, cur, n;
int X[200010];
int P[200010];
vector<pair<int, int> > Vp;
deque<int> Dm;
long long res;
void Dpush(int p) {
  while (!Dm.empty() && Dm.back() > p) Dm.pop_back();
  Dm.push_back(p);
}
void Dpop(int p) {
  if (!Dm.empty() && Dm.front() == p) Dm.pop_front();
}
int Dmin() {
  if (Dm.empty()) return 1000 * 1000 + 3;
  return Dm.front();
}
int main() {
  ios_base::sync_with_stdio(0);
  scanf("%d %d %d", &d, &tot, &n);
  cur = tot;
  X[0] = 0;
  P[0] = 1000 * 1000 + 3;
  for (int i = (1); i < (n + 1); ++i) {
    int first, p;
    scanf("%d %d", &first, &p);
    Vp.push_back(pair<int, int>(first, p));
  }
  sort(Vp.begin(), Vp.end());
  for (int i = (0); i < (n); ++i) {
    X[i + 1] = Vp[i].first;
    P[i + 1] = Vp[i].second;
  }
  X[n + 1] = d;
  P[n + 1] = P[0];
  int a = 0, b = 0;
  while (a < n + 1) {
    while (b <= n + 1 && X[b] - X[a] <= cur) {
      Dpush(P[b]);
      ++b;
    }
    if (cur == tot || Dmin() < P[a] || b > n + 1) {
      if (X[a + 1] - X[a] > tot) {
        printf("-1\n");
        return 0;
      }
      assert(cur >= X[a + 1] - X[a]);
      cur -= X[a + 1] - X[a];
      Dpop(P[a]);
      ++a;
    } else {
      res += P[a] * (long long)(min(tot, X[b] - X[a]) - cur);
      cur = min(tot, X[b] - X[a]);
    }
  }
  cout << res << endl;
  return 0;
}
