#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a, long long b, long long m = 1000000007) {
  a %= m;
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long bpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long modinv(long long a) { return modpow(a, 1000000007 - 2, 1000000007); }
void graph(vector<vector<int>> &adj, int m) {
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    adj[x - 1].push_back(y - 1);
    adj[y - 1].push_back(x - 1);
  }
}
struct hash_pair {
  template <class T1, class T2>
  size_t operator()(const pair<T1, T2> &p) const {
    auto hash1 = hash<T1>{}(p.first);
    auto hash2 = hash<T2>{}(p.second);
    return hash1 ^ hash2;
  }
};
const int mxN = 2e5 + 5;
void solve() {
  long long d, n, m;
  cin >> d >> n >> m;
  vector<pair<long long, long long>> v;
  for (int i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  long long tank = n;
  sort(v.begin(), v.end());
  stack<pair<long long, int>> s;
  long long ans[(int)v.size()];
  s.push({v[0].second, 0});
  for (int i = 1; i < m; i++) {
    if (s.empty()) {
      s.push({v[i].second, i});
      continue;
    }
    while (s.empty() == false && s.top().first >= v[i].second) {
      ans[s.top().second] = v[i].first;
      s.pop();
    }
    s.push({v[i].second, i});
  }
  while (s.empty() == false) {
    ans[s.top().second] = d;
    s.pop();
  }
  long long prev = 0;
  long long total = 0;
  for (int i = 0; i < m; i++) {
    if (v[i].first - prev > tank) {
      cout << -1;
      return;
    }
    tank -= (v[i].first - prev);
    prev = v[i].first;
    total +=
        1LL * v[i].second * max(0LL, min(n - tank, ans[i] - v[i].first - tank));
    tank += max(0LL, min(n - tank, ans[i] - v[i].first - tank));
  }
  if (d - v[m - 1].first > tank) {
    cout << -1;
    return;
  }
  cout << total << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) {
    solve();
  }
}
