#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
const int inf = 1e9 + 100;
int d, n, m;
pair<int, int> A[MAXN];
int dist[MAXN];
void load() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &A[i].first, &A[i].second);
  }
  A[m++] = {d, 0};
  sort(A, A + m);
  stack<int> S;
  for (int i = m - 1; i >= 0; i--) {
    while (!S.empty() && A[S.top()].second > A[i].second) S.pop();
    if (S.empty())
      dist[i] = inf;
    else
      dist[i] = A[S.top()].first - A[i].first;
    S.push(i);
  }
  dist[m - 1] = 0;
}
bool solve() {
  int curr = n;
  int pos = 0;
  long long sol = 0;
  for (int i = 0; i < m; i++) {
    int raz = A[i].first - pos;
    if (curr < raz) return false;
    curr -= raz;
    int dis = min(n, dist[i]);
    if (curr < dis) {
      sol += (long long)(dis - curr) * A[i].second;
      curr = dis;
    }
    pos = A[i].first;
  }
  printf("%I64d\n", sol);
  return true;
}
int main() {
  load();
  if (!solve()) printf("-1\n");
  return 0;
}
