#include <bits/stdc++.h>
using namespace std;
int break_point() {
  char c;
  while ((c = getchar()) != '\n')
    ;
  return 0;
}
template <typename T>
void read_integer(T &r) {
  bool sign = 0;
  r = 0;
  char c;
  while (1) {
    c = getchar();
    if (c == '-') {
      sign = 1;
      break;
    }
    if (c != ' ' && c != '\n') {
      r = c - '0';
      break;
    }
  }
  while (1) {
    c = getchar();
    if (c == ' ' || c == '\n') break;
    r = r * 10 + (c - '0');
  }
  if (sign) r = -r;
}
long long binpowmod(long long a, long long b, long long mod) {
  if (b == 0) return 1;
  long long c = binpowmod(a, b >> 1, mod);
  return (((c * c) % mod) * (b & 1 ? a : 1)) % mod;
}
long long binpow(long long a, long long b) {
  if (b == 0) return 1;
  long long c = binpow(a, b >> 1);
  return c * c * (b & 1 ? a : 1);
}
inline int getbit(int x, int b) { return (x >> b) & 1; }
inline int setbit(int x, int b) { return x | (1 << b); }
inline void _setbit(int &x, int b) { x = setbit(x, b); }
inline long long setbit(long long x, int b) { return x | (1ll << b); }
inline void _setbit(long long &x, int b) { x = setbit(x, b); }
inline int unsetbit(int x, int b) { return x & (INT_MAX - (1 << b)); }
inline void _unsetbit(int &x, int b) { x = unsetbit(x, b); }
inline int countbit(int x) {
  x = x - ((x >> 1) & 0x55555555);
  x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
  return ((x + (x >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}
inline long long countbit(long long x) {
  return countbit(int(x & INT_MAX)) + countbit(int(x >> 32) & INT_MAX);
}
inline void printbit(int x, int len) {
  for (int i = len - 1; i >= 0; i--) printf("%d", getbit(x, i));
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
template <typename A, typename B>
ostream &operator<<(ostream &stream, const pair<A, B> &p) {
  stream << "{" << p.first << "," << p.second << "}";
  return stream;
}
template <typename A>
ostream &operator<<(ostream &stream, const vector<A> &v) {
  stream << "[";
  for (auto itr = v.begin(); itr != v.end(); itr++) stream << *itr << " ";
  stream << "]";
  return stream;
}
template <typename A, typename B>
ostream &operator<<(ostream &stream, const map<A, B> &v) {
  stream << "[";
  for (auto itr = v.begin(); itr != v.end(); itr++) stream << *itr << " ";
  stream << "]";
  return stream;
}
template <typename A>
ostream &operator<<(ostream &stream, const set<A> &v) {
  stream << "[";
  for (auto itr = v.begin(); itr != v.end(); itr++) stream << *itr << " ";
  stream << "]";
  return stream;
}
template <typename A>
ostream &operator<<(ostream &stream, const stack<A> &v) {
  stack<A> st;
  stream << "[";
  while (!st.empty()) {
    stream << st.top() << " ";
    st.pop();
  }
  stream << "]";
  return stream;
}
template <typename A>
ostream &operator<<(ostream &stream, const priority_queue<A> &v) {
  priority_queue<A> q = v;
  stream << "[";
  while (!q.empty()) {
    stream << q.top() << " ";
    q.pop();
  }
  stream << "]";
  return stream;
}
template <typename A>
ostream &operator<<(ostream &stream, const queue<A> &v) {
  queue<A> q = v;
  stream << "[";
  while (!q.empty()) {
    stream << q.front() << " ";
    q.pop();
  }
  stream << "]";
  return stream;
}
void run();
int main() {
  srand(time(NULL));
  do {
    run();
    if (0) {
      0 ? printf("-------------------------------\n") : 0;
      0 ? printf("-------------------------------\n") : 0;
    }
  } while (0);
  return 0;
}
template <typename T>
struct min_queue {
  stack<T> push_st, pop_st;
  queue<T> q;
  T min_push;
  void push(T v) {
    if (push_st.empty())
      min_push = v;
    else
      min_push = (v.second < min_push.second ? v : min_push);
    push_st.push(v);
    q.push(v);
  }
  void refill() {
    while (!push_st.empty()) {
      pop_st.push(pop_st.empty() || push_st.top().second < pop_st.top().second
                      ? push_st.top()
                      : pop_st.top());
      push_st.pop();
    }
  }
  T front() { return q.front(); }
  void pop() {
    if (pop_st.empty()) refill();
    if (!pop_st.empty()) pop_st.pop();
    q.pop();
  }
  bool empty() { return push_st.empty() && pop_st.empty(); }
  int size() { return int(pop_st.size()) + int(push_st.size()); }
  T get_min() {
    if (pop_st.empty())
      return min_push;
    else if (push_st.empty())
      return pop_st.top();
    else {
      if (min_push.second < pop_st.top().second)
        return min_push;
      else
        return pop_st.top();
    }
  }
};
pair<int, int> gs[200005];
void run() {
  int n, d, m;
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 0; i < m; i++) scanf("%d%d", &gs[i].first, &gs[i].second);
  gs[m] = {d, 0};
  sort(gs, gs + m);
  long long res = 0;
  min_queue<pair<int, int> > q;
  int p = 1;
  int b = n;
  for (int i = 0; i < m; i++) {
    b -= gs[i].first - (i == 0 ? 0 : gs[i - 1].first);
    while (!q.empty() && q.front().first <= i) q.pop();
    while (p <= m && gs[p].first <= gs[i].first + n) {
      q.push({p, gs[p].second});
      p++;
    }
    if (b < 0 || q.empty()) {
      printf("-1\n");
      return;
    }
    pair<int, int> mn = q.get_min();
    if (mn.second > gs[i].second) {
      res += 1ll * (n - b) * gs[i].second;
      b = n;
    } else {
      while (q.front().second > gs[i].second) q.pop();
      mn = q.front();
      int need = max(0, min(n - b, gs[mn.first].first - gs[i].first - b));
      res += 1ll * need * gs[i].second;
      b += need;
    }
  }
  printf("%lld", res);
  putchar('\n');
}
