#include <bits/stdc++.h>
using namespace std;
struct station {
  int x, pri;
} sta[200005];
bool cmpx(const station &a, const station &b) { return a.x < b.x; }
int d, n, m;
int st[20][200005];
int LOG[200005];
void build() {
  for (int i = 1; i <= m; i++) st[0][i] = i;
  for (int i = 1; (1 << i) <= m; i++)
    for (int j = 1, t = m + 1 - (1 << i), t1, t2; j <= t; j++)
      st[i][j] = sta[t1 = st[i - 1][j]].pri <
                         sta[t2 = st[i - 1][j + (1 << (i - 1))]].pri
                     ? t1
                     : t2;
  for (int i = 2; i <= m; i++) LOG[i] = LOG[i >> 1] + 1;
}
int query(int l, int r) {
  int d = LOG[r - l + 1], t1, t2;
  return sta[t1 = st[d][l]].pri < sta[t2 = st[d][r - (1 << d) + 1]].pri ? t1
                                                                        : t2;
}
long long ans;
void solve(int l, int r) {
  if (sta[r].x - sta[l].x <= n) return;
  int mid = query(l + 1, r - 1);
  int res = 0;
  if (sta[mid].x - sta[l].x > n)
    solve(l, mid);
  else
    res = n - (sta[mid].x - sta[l].x);
  ans += (long long)(n - res) * sta[mid].pri;
  if (sta[r].x - sta[mid].x > n)
    solve(mid, r);
  else
    ans -= (n - (sta[r].x - sta[mid].x)) * (long long)sta[mid].pri;
}
int main() {
  scanf("%d%d%d", &d, &n, &m);
  sta[0] = (station){0, 0};
  for (int i = 2; i <= m + 1; i++) scanf("%d%d", &sta[i].x, &sta[i].pri);
  sta[m += 2] = (station){d, 0};
  sort(sta + 1, sta + m + 1, cmpx);
  build();
  for (int i = 2; i <= m; i++)
    if (sta[i].x - sta[i - 1].x > n) return puts("-1"), 0;
  solve(1, m);
  cout << ans << endl;
  return 0;
}
