#include <bits/stdc++.h>
using namespace std;
template <typename T>
class heap : public priority_queue<T, vector<T>, greater<T> > {};
const int n = 200047;
int l[n];
int main(void) {
  int d, n, m;
  scanf("%d%d%d", &d, &n, &m);
  vector<pair<int, int> > g;
  for (int i = 0; i < m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    g.push_back({a, b});
  }
  g.push_back({0, 0});
  sort(g.begin(), g.end());
  g.push_back({d, 0});
  stack<int> s;
  for (int i = g.size() - 1; i >= 0; --i) {
    while (!s.empty() && g[s.top()].second > g[i].second) s.pop();
    l[i] = s.empty() ? g.size() - 1 : s.top();
    s.push(i);
  }
  long long ans = 0;
  int gas = n;
  for (int i = 1; i < g.size(); ++i) {
    gas -= g[i].first - g[i - 1].first;
    if (gas < 0) {
      puts("-1");
      return 0;
    }
    int missing = n - gas;
    int rem = g[l[i]].first - g[i].first;
    int newgas = min(rem, n);
    if (newgas > gas) {
      ans += 1LL * (newgas - gas) * g[i].second;
      gas = newgas;
    }
  }
  printf("%lld\n", ans);
}
