#include <bits/stdc++.h>
using namespace std;
int64_t d, n, m, fuel, cost = 0;
pair<int64_t, int64_t> x[200010];
int nxt[200010];
int main() {
  scanf("%d%d%d", &d, &n, &m);
  fuel = n;
  for (int i = 0; i < m; i++) {
    int a, y;
    scanf("%d%d", &a, &y);
    x[i] = {a, y};
  }
  x[m] = {d, 0};
  x[m + 1] = {0, 1e10};
  m += 2;
  sort(x, x + m);
  stack<int> z;
  z.push(m - 1);
  for (int i = m - 2; i >= 0; i--) {
    while (z.size() > 0 && x[z.top()].second > x[i].second) z.pop();
    nxt[i] = z.top();
    z.push(i);
  }
  for (int i = 0;;) {
    if (fuel < 0) {
      printf("-1\n");
      return 0;
    }
    if (i == m - 1) break;
    int d = x[nxt[i]].first - x[i].first;
    if (d <= n) {
      if (fuel <= d) {
        cost += (d - fuel) * x[i].second;
        fuel = 0;
      } else
        fuel -= d;
      i = nxt[i];
    } else {
      if (i == 0) {
        printf("-1\n");
        return 0;
      }
      cost += (n - fuel) * x[i].second;
      fuel = n;
      fuel -= x[i + 1].first - x[i].first;
      i++;
    }
  }
  printf("%I64d\n", cost);
  return 0;
}
