#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
#pragma warning(disable : 4996)
#pragma hdrstop
namespace std {}
namespace Random {}
inline bool is_digit(const char ch) { return (ch >= '0' && ch <= '9'); }
class IO {
 public:
  constexpr static const std::size_t kBufferSize = 1 << 18;
  IO()
      : read_bytes_count_(0),
        read_buffer_offset_(0),
        current_char_(0),
        eof_(false) {
    static_assert(kBufferSize > 32,
                  "Size of a buffer must be greater than 32 due to comparison "
                  "in IO::flush() method.");
  }
  ~IO() { flush(); }
  IO(const IO&) = delete;
  IO& operator=(const IO&) = delete;
  IO(const IO&&) = delete;
  IO& operator=(const IO&&) = delete;
  inline void shift_char();
  inline int32_t next_int();
  IO& operator>>(int32_t& x);
  inline void flush();
  inline void new_line();
  inline void print_int(const int32_t x);
  inline void print_long(const int64_t x);
  IO& operator<<(const int32_t x);
  IO& operator<<(const int64_t x);
  IO& operator<<(std::ostream& (*)(std::ostream&));

 private:
  using Buffer = std::array<char, kBufferSize>;
  Buffer read_buffer_;
  Buffer write_buffer_;
  std::size_t read_bytes_count_;
  std::size_t read_buffer_offset_;
  std::size_t write_buffer_offset_;
  bool eof_;
  char current_char_;
  inline void update_buffer();
  template <typename T>
  T read_number();
  template <typename T>
  void print_number(const T& value);
};
extern bool useFastIO;
extern std::istream* pin;
extern std::ostream* pout;
extern IO io;
inline int32_t next_int();
inline void new_line();
inline void print_int(const int32_t x);
inline void print_long(const int64_t x);
using namespace std;
IO io;
void solve(istream& ins, ostream& out) {
  int d, v, n;
  io >> d >> v >> n;
  vector<std::pair<int, int> > a;
  a.emplace_back(0, 0);
  a.emplace_back(d, 0);
  for (int i = 0; i < n; ++i) {
    int x, y;
    io >> x >> y;
    a.emplace_back(x, y);
  }
  sort(a.begin(), a.end());
  for (int i = 1; i < a.size(); ++i) {
    if (a[i].first - a[i - 1].first > v) {
      io << -1 << endl;
      return;
    }
  }
  vector<int> nxt(a.size());
  vector<std::pair<int, int> > st;
  for (int i = 0; i < a.size(); ++i) {
    while (!st.empty() && a[i].second <= st.back().first) {
      nxt[st.back().second] = i;
      st.pop_back();
    }
    st.emplace_back(a[i].second, i);
  }
  int pos = 0;
  int64_t ans = 0;
  int cur_ind = 1;
  int last_pos = 0;
  int cur_vol = v;
  int beg = 0;
  while (pos < a.size() - 1) {
    cur_vol -= a[pos].first - last_pos;
    last_pos = a[pos].first;
    auto& it = a[nxt[pos]];
    int new_vol = cur_vol;
    int new_pos = pos;
    if (it.first - a[pos].first > v || it.second > a[pos].second) {
      new_vol = v;
      new_pos = pos + 1;
    } else {
      new_vol = max(cur_vol, it.first - a[pos].first);
      new_pos = nxt[pos];
    }
    ans += (int64_t)a[pos].second * (new_vol - cur_vol);
    cur_vol = new_vol;
    pos = new_pos;
  }
  io << ans << endl;
}
extern class IO io;
bool useFastIO = false;
istream* pin;
ostream* pout;
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  useFastIO = true;
  ostream& out = cout;
  out << fixed << setprecision(16);
  pin = &in;
  pout = &out;
  solve(in, out);
  return 0;
}
template <typename T>
T IO::read_number() {
  bool is_negative = false;
  while (!eof_ && !is_digit(current_char_) &&
         (std::is_unsigned<T>() || current_char_ != '-')) {
    shift_char();
  }
  if (std::is_signed<T>() && current_char_ == '-') {
    is_negative = true;
    shift_char();
  }
  T result = 0;
  while (!eof_ && is_digit(current_char_)) {
    result = (result << 3) + (result << 1) + current_char_ - '0';
    shift_char();
  }
  return (is_negative ? result * -1 : result);
}
template <typename T>
void IO::print_number(const T& value) {
  T current_value = value;
  if (write_buffer_offset_ + 32 > kBufferSize) {
    flush();
  }
  if (current_value < 0) {
    write_buffer_[write_buffer_offset_++] = '-';
    current_value = abs(current_value);
  } else if (current_value == 0) {
    write_buffer_[write_buffer_offset_++] = '0';
    return;
  }
  std::size_t start_index = write_buffer_offset_;
  while (current_value != 0) {
    write_buffer_[write_buffer_offset_++] = current_value % 10 + '0';
    current_value /= 10;
  }
  std::reverse(write_buffer_.begin() + start_index,
               write_buffer_.begin() + write_buffer_offset_);
}
inline void IO::update_buffer() {
  if (read_buffer_offset_ == read_bytes_count_) {
    read_bytes_count_ = fread(&read_buffer_[0], sizeof(read_buffer_[0]),
                              read_buffer_.size(), stdin);
    if (read_bytes_count_ == 0) {
      eof_ = true;
      return;
    }
    read_buffer_offset_ = 0;
  }
}
inline void IO::shift_char() {
  update_buffer();
  current_char_ = read_buffer_[read_buffer_offset_++];
}
inline int32_t IO::next_int() { return read_number<int32_t>(); }
IO& IO::operator>>(int32_t& x) {
  x = ::next_int();
  return *this;
}
inline void IO::flush() {
  fwrite(&write_buffer_[0], sizeof(write_buffer_[0]), write_buffer_offset_,
         stdout);
  write_buffer_offset_ = 0;
}
inline void IO::new_line() {
  if (write_buffer_offset_ == kBufferSize) {
    flush();
  }
  write_buffer_[write_buffer_offset_++] = '\n';
}
inline void IO::print_int(const int32_t x) { print_number(x); }
inline void IO::print_long(const int64_t x) { print_number(x); }
IO& IO::operator<<(const int32_t x) {
  ::print_int(x);
  return *this;
}
IO& IO::operator<<(const int64_t x) {
  ::print_long(x);
  return *this;
}
IO& IO::operator<<(std::ostream& (*)(std::ostream&)) {
  ::new_line();
  return *this;
}
inline int32_t next_int() {
  if (useFastIO) {
    return io.next_int();
  }
  int32_t ret;
  *pin >> ret;
  return ret;
}
inline void new_line() {
  if (useFastIO) {
    io.new_line();
    return;
  }
  *pout << std::endl;
}
inline void print_int(const int32_t x) {
  if (useFastIO) {
    io.print_int(x);
    return;
  }
  *pout << x;
}
inline void print_long(const int64_t x) {
  if (useFastIO) {
    io.print_long(x);
    return;
  }
  *pout << x;
}
