#include <bits/stdc++.h>
using namespace std;
const int MaxN = 200010;
pair<int, int> sta[MaxN], h[MaxN];
set<int> S;
int d, n, m, nxt[MaxN];
void failed() {
  puts("-1");
  exit(0);
}
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; ++i) scanf("%d%d", &sta[i].first, &sta[i].second);
  sort(sta + 1, sta + m + 1);
  sta[m + 1].first = d;
  for (int i = 1; i <= m + 1; ++i) {
    h[i].first = sta[i].second;
    h[i].second = i;
  }
  sort(h + 1, h + m + 2);
  for (int i = 1; i <= m + 1; ++i) {
    if (S.upper_bound(h[i].second) != S.end())
      nxt[h[i].second] = *S.upper_bound(h[i].second);
    S.insert(h[i].second);
  }
  long long cost = 0;
  int now = 0, oil = 0;
  while (now <= m) {
    if (nxt[now] && (sta[nxt[now]].first <= sta[now].first + n)) {
      int add = max(0, sta[nxt[now]].first - sta[now].first - oil);
      cost += 1ll * add * sta[now].second;
      oil += add;
      oil -= sta[nxt[now]].first - sta[now].first;
      now = nxt[now];
    } else {
      if (sta[now + 1].first > sta[now].first + n) failed();
      int add = n - oil;
      cost += 1ll * add * sta[now].second;
      oil += add;
      oil -= sta[now + 1].first - sta[now].first;
      now = now + 1;
    }
  }
  cout << cost << endl;
  return 0;
}
