#include <bits/stdc++.h>
const int N = 200200;
using namespace std;
pair<int, int> a[N], p[N];
int d, n, m;
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 0; i < m; ++i) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a, a + m);
  a[m++] = {d, 0};
  long long sum = 0;
  int pos = 0, cur = n;
  p[0] = {n, 0};
  int x = 0, y = 0;
  for (int i = 0; i < m; ++i) {
    int need = a[i].first - pos;
    while (need > 0 && x <= y) {
      if (need <= p[x].first) {
        p[x].first -= need;
        cur -= need;
        need = 0;
      } else {
        need -= p[x].first;
        cur -= p[x].first;
        ++x;
      }
    }
    if (need > 0) {
      puts("-1");
      return 0;
    }
    while (a[i].second < p[y].second && y >= x) {
      sum -= 1LL * p[y].first * p[y].second;
      cur -= p[y].first;
      --y;
    }
    p[++y] = {n - cur, a[i].second};
    sum += 1LL * (n - cur) * a[i].second;
    cur = n;
    pos = a[i].first;
  }
  for (int i = x; i <= y; ++i) sum -= 1LL * p[i].first * p[i].second;
  printf("%I64d\n", sum);
  return 0;
}
