#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[200010], q[200010];
long long d, n, m, l = 1, r = 0, sum;
int main(void) {
  cin >> d >> n >> m;
  for (int i = 1; i <= m; i++) cin >> a[i].first >> a[i].second;
  sort(a + 1, a + m + 1);
  a[++m].first = d;
  long long now = n, pos = 0, ans = 0;
  for (int i = 1; i <= m; i++) {
    while (a[i].first - pos > now) {
      if (l > r) {
        cout << "-1";
        exit(0);
      }
      long long dt = min(a[i].first - pos - now, q[l].second - sum);
      ans += dt * q[l].first;
      now += dt, sum += dt;
      while (l <= r && q[l].second <= sum) l++;
    }
    now -= a[i].first - pos;
    pos = a[i].first;
    while (l <= r && a[i].second <= q[r].first) r--;
    q[++r].first = a[i].second, q[r].second = n - now + sum;
  }
  cout << ans;
}
