#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
void scan() {}
template <typename F, typename... R>
void scan(F& f, R&... r) {
  cin >> f;
  scan(r...);
}
int di_;
string dnms_, co_ = ",";
void debug_() { cout << endl; }
template <typename F, typename... R>
void debug_(F& f, R&... r) {
  while (dnms_[di_] != ',') cout << dnms_[di_++];
  di_++;
  cout << ": " << f << ",";
  debug_(r...);
}
template <class A, class B>
ostream& operator<<(ostream& out, const pair<A, B>& a) {
  return out << "(" << a.first << "," << a.second << ")";
}
template <class A>
ostream& operator<<(ostream& out, const vector<A>& a) {
  out << "";
  for (auto it = a.begin(); it != a.end(); it++) {
    if (it != a.begin()) out << " ";
    out << *it;
  }
  out << "";
  return out;
}
template <class A, class B>
istream& operator>>(istream& in, pair<A, B>& a) {
  in >> a.first >> a.second;
  return in;
}
template <class A>
istream& operator>>(istream& in, vector<A>& a) {
  for (A& i : a) in >> i;
  return in;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, d, m;
  cin >> d >> n >> m;
  vector<pair<int, int> > v(m);
  cin >> v;
  sort(v.begin(), v.end());
  while (v.back().first >= d) v.pop_back();
  v.push_back({d, 0});
  int currgas = n - v[0].first, maxgas = n, gassneeded = 0;
  int pos = (currgas >= 0) ? v[0].first : -1;
  if (pos == -1) {
    cout << -1 << endl;
    return 0;
  }
  vector<int> nextsmall(m, -1);
  stack<int> s;
  s.push(0);
  for (int i = 1; i < m; i++) {
    while (!s.empty() && v[s.top()].second > v[i].second) {
      nextsmall[s.top()] = i;
      s.pop();
    }
    s.push(i);
  }
  int station = 0;
  long long int cost = 0;
  while (station < m) {
    gassneeded =
        min(maxgas, (nextsmall[station] == -1
                         ? d - v[station].first
                         : (v[nextsmall[station]].first - v[station].first)));
    if (currgas < gassneeded) {
      long long int rem = gassneeded - currgas;
      currgas += rem;
      cost += rem * v[station].second;
    }
    station++;
    currgas -= v[station].first - v[station - 1].first;
    if (currgas < 0) break;
    pos += v[station].first - v[station - 1].first;
  }
  if (pos < d) cost = -1;
  cout << cost << endl;
  return 0;
}
