#include <bits/stdc++.h>
using namespace std;
void sc(int& a) { scanf("%d", &a); }
void sc(long long int& a) { scanf("%lld", &a); }
void sc(int& a, int& b) {
  sc(a);
  sc(b);
}
void sc(long long int& a, long long int& b) {
  sc(a);
  sc(b);
}
void sc(int& a, int& b, int& c) {
  sc(a, b);
  sc(c);
}
void sc(long long int& a, long long int& b, long long int& c) {
  sc(a, b);
  sc(c);
}
void prl(int a) { printf("%d\n", a); }
void prl(long long int a) { printf("%lld\n", a); }
void prl() { printf("\n"); }
void prs(int a) { printf("%d ", a); }
void prs(long long int a) { printf("%lld ", a); }
void prl(long long int a, long long int b) {
  cout << a << " " << b << " " << endl;
}
void prl(long long int a, long long int b, long long int c) {
  cout << a << " " << b << " " << c << " " << endl;
}
void prl(long long int a, long long int b, long long int c, long long int d) {
  cout << a << " " << b << " " << c << " " << d << endl;
}
void prl(long long int a, long long int b, long long int c, long long int d,
         long long int e) {
  cout << a << " " << b << " " << c << " " << d << " " << e << endl;
}
void prl(long long int a, long long int b, long long int c, long long int d,
         long long int e, long long int f) {
  cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
}
int mod = 1000000007;
long long int modpow(long long int a, long long int b, long long int mod) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b = b / 2;
  }
  return res % mod;
}
int dist[200000 + 5], minn[200000 + 5];
pair<int, int> p[200000 + 5];
vector<int> v;
int main() {
  int d, n, m, flag = 0;
  sc(d, n, m);
  for (int i = 1; i <= m; i++) {
    sc(p[i].first, p[i].second);
  }
  sort(p + 1, p + m + 1);
  p[m + 1] = make_pair(d, 0);
  v.push_back(1);
  for (int i = 1; i <= m; i++) minn[i] = INT_MAX;
  int i = 2;
  while (i <= m) {
    if (v.empty()) {
      v.push_back(i);
      i++;
      continue;
    }
    if (p[i].second > p[v.back()].second) {
      v.push_back(i);
      i++;
      continue;
    }
    while (!v.empty() and p[i].second <= p[v.back()].second) {
      minn[v.back()] = i;
      v.pop_back();
    }
    v.push_back(i);
    i++;
  }
  long long int ans = 0, curr_fuel = n, fuel_bought, dist_to_next_station,
                dist_to_dest;
  for (int i = 1; i <= m + 1; i++) {
    if (p[i].first - p[i - 1].first > curr_fuel) {
      prl(-1);
      return 0;
    }
    if (i == m + 1) break;
    curr_fuel -= (p[i].first - p[i - 1].first);
    int next_station = minn[i];
    if (next_station == INT_MAX) {
      dist_to_dest = p[m + 1].first - p[i].first;
      if (curr_fuel >= dist_to_dest)
        fuel_bought = 0;
      else
        fuel_bought = min(dist_to_dest - curr_fuel, n - curr_fuel);
      curr_fuel += fuel_bought;
      ans += 1LL * fuel_bought * p[i].second;
    } else {
      dist_to_next_station = p[next_station].first - p[i].first;
      if (curr_fuel >= dist_to_next_station)
        fuel_bought = 0;
      else
        fuel_bought = dist_to_next_station - curr_fuel;
      fuel_bought = min(fuel_bought, n - curr_fuel);
      curr_fuel += fuel_bought;
      ans += 1LL * fuel_bought * p[i].second;
    }
  }
  prl(ans);
}
