#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
int main(int argc, const char **argv) {
  redirect(argc, argv);
  int M;
  long long D, vol;
  cin >> D >> vol >> M;
  vector<pair<long long, long long> > stations(M + 2);
  for (int i = 0; i < M; i++) cin >> stations[i].first >> stations[i].second;
  stations[M] = pair<long long, long long>(D, 0);
  stations[M + 1] = pair<long long, long long>(0, 1);
  M += 2;
  sort(begin(stations), end(stations));
  vector<int> nextc(M);
  stack<int> cheap;
  cheap.push(M - 1);
  for (int i = M - 2; i >= 0; i--) {
    while (stations[i].second <= stations[cheap.top()].second) cheap.pop();
    nextc[i] = cheap.top();
    cheap.push(i);
  }
  long long tank = vol;
  int pos = 0;
  long long cost = 0;
  while (pos < M - 1) {
    int n = nextc[pos];
    long long d = stations[n].first - stations[pos].first;
    if (d <= vol) {
      if (tank < d) {
        cost += (d - tank) * stations[pos].second;
        tank = d;
      }
      pos = n;
      tank -= d;
    } else {
      cost += (vol - tank) * stations[pos].second;
      tank = vol;
      d = stations[pos + 1].first - stations[pos].first;
      if (d > vol) {
        cout << "-1\n";
        return 0;
      }
      tank -= d;
      pos++;
    }
  }
  cout << cost << '\n';
  return 0;
}
