#include <bits/stdc++.h>
using ll = long long;
const int maxn = 5e5 + 22;
int n, nxt[maxn];
ll d, m, ans;
struct station {
  ll x, c;
} p[maxn];
int main() {
  scanf("%lld%lld%d", &d, &m, &n);
  for (int i = 1; i <= n; ++i) scanf("%lld%lld", &p[i].x, &p[i].c);
  std::sort(p + 1, p + n + 1, [](station a, station b) { return a.x < b.x; });
  p[0].x = 0;
  p[n + 1].x = d;
  p[0].c = 0;
  p[n + 1].c = -1;
  std::stack<ll> stk;
  stk.push(n + 1);
  for (int i = n; i >= 0; i--) {
    while (p[stk.top()].c >= p[i].c) stk.pop();
    nxt[i] = stk.top();
    stk.push(i);
  }
  ll fuel = 0;
  for (int i = 0; i <= n; ++i) {
    ll g = std::min(m - fuel, std::max(0ll, p[nxt[i]].x - p[i].x - fuel));
    ans += g * p[i].c;
    fuel += g;
    fuel -= (p[i + 1].x - p[i].x);
    if (fuel < 0) {
      puts("-1");
      return 0;
    }
  }
  printf("%lld", ans);
  return 0;
}
