#include <bits/stdc++.h>
using namespace std;
const int N = 2e4;
const long long INF = 1e18 + 10;
const long long MOD = 1e9 + 7;
const long double EPS = 1e-9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int d, n, m;
  cin >> d >> n >> m;
  vector<pair<int, int> > v(m + 1, {0, 0});
  for (int i = (1), ThxMK = (m + 1); i < ThxMK; ++i)
    cin >> v[i].first >> v[i].second;
  sort(begin(v), end(v));
  stack<pair<int, int> > second;
  second.push({d, 0});
  vector<int> who(m + 1);
  for (int i = m; i; i--) {
    while (second.top().second >= v[i].second) second.pop();
    who[i] = second.top().first;
    second.push(v[i]);
  }
  v.push_back({d, 0});
  int act = n;
  long long res = 0;
  for (int i = (1), ThxMK = (int(v.size())); i < ThxMK; ++i) {
    act -= v[i].first - v[i - 1].first;
    if (act < 0) {
      cout << -1 << '\n';
      return 0;
    }
    if (who[i] - v[i].first <= act) continue;
    res += 1LL * min(n - act, who[i] - v[i].first - act) * v[i].second;
    act += min(n - act, who[i] - v[i].first - act);
  }
  cout << res << '\n';
}
