#include <bits/stdc++.h>
template <typename T = int>
std::vector<T> ReadVector(size_t size) {
  std::vector<T> vector(size);
  for (auto& element : vector) {
    std::cin >> element;
  }
  return vector;
}
template <class Number, class Predicate>
Number BinarySearch(Number begin, Number end, Predicate predicate) {
  Number left = begin;
  Number right = end;
  assert(left <= right);
  while (right - left > 1) {
    auto center = left + ((right - left) >> 1);
    if (predicate(center)) {
      right = center;
    } else {
      left = center;
    }
  }
  return right;
}
class Graph {
 public:
  std::vector<std::vector<int>> children;
  std::vector<bool> used;
  Graph() = default;
  explicit Graph(size_t vertices) : children(vertices), used(vertices) {}
  void add_edge(int from, int to) {
    children[from].push_back(to);
    children[to].push_back(from);
  }
  void bfs(int root) {
    std::queue<int> to_observe({root});
    used.assign(children.size(), false);
    while (!to_observe.empty()) {
      auto vertex = to_observe.front();
      to_observe.pop();
      used[vertex] = true;
      for (auto child : children[vertex]) {
        if (!used[child]) {
          to_observe.push(child);
        }
      }
    }
  }
  void dfs(int root) {
    used.assign(children.size(), false);
    dfs_rec(root);
  }
  void dfs_rec(int root) {
    used[root] = true;
    for (auto child : children[root]) {
      if (!used[child]) {
        dfs_rec(child);
      }
    }
  }
};
int64_t gcd(int64_t a, int64_t b) {
  while (b) {
    a %= b;
    std::swap(a, b);
  }
  return a;
}
template <class T>
const T plus(const T& x, const T& y) {
  return x + y;
}
template <class T, const T (*binary_function)(const T&, const T&)>
class SegmentTree {
  class IndexedElement {
   public:
    size_t index;
    SegmentTree<T, binary_function>* segment_tree;
    IndexedElement(SegmentTree<T, binary_function>* segment_tree, size_t index)
        : segment_tree(segment_tree), index(index) {}
    IndexedElement& operator=(T value) {
      segment_tree->Update(index, value);
      return *this;
    }
    operator T() { return segment_tree->Get(index, index); }
  };
  size_t size;
  std::vector<T> tree;

 public:
  explicit SegmentTree(const std::vector<T>& original)
      : size(original.size()), tree(size * 4) {
    Build(original);
  }
  explicit SegmentTree(size_t size) : size(size), tree(size * 4, 0) {}
  SegmentTree& operator=(const std::vector<T>& original) {
    Build(original);
    return *this;
  }

 public:
  T Get(size_t left, size_t right) const {
    return _Get(1, 0, size - 1, left, right);
  }
  const T operator()(size_t left, size_t right) const {
    return _Get(1, 0, size - 1, left, right);
  }
  const T operator[](size_t index) const { return _Get(index, index); }
  IndexedElement operator[](size_t index) {
    return IndexedElement(this, index);
  }

 public:
  void Build(const std::vector<T>& original) {
    _Build(original, 1, 0, size - 1);
  }
  void _Build(const std::vector<T>& original, size_t vertex, size_t t_left,
              size_t t_right) {
    if (t_left == t_right) {
      tree[vertex] = original[t_left];
    } else {
      size_t t_middle = (t_left + t_right) >> 1;
      _Build(original, vertex * 2, t_left, t_middle);
      _Build(original, vertex * 2 + 1, t_middle + 1, t_right);
      tree[vertex] = binary_function(tree[vertex * 2], tree[vertex * 2 + 1]);
    }
  }
  T _Get(size_t vertex, size_t t_left, size_t t_right, size_t left,
         size_t right) const {
    if (left == t_left && right == t_right) {
      return tree[vertex];
    }
    size_t t_middle = (t_left + t_right) >> 1;
    if (right <= t_middle) {
      return _Get(vertex * 2, t_left, t_middle, left, right);
    } else if (t_middle + 1 <= left) {
      return _Get(vertex * 2 + 1, t_middle + 1, t_right, left, right);
    } else {
      return binary_function(
          _Get(vertex * 2, t_left, t_middle, left, t_middle),
          _Get(vertex * 2 + 1, t_middle + 1, t_right, t_middle + 1, right));
    }
  }
  void Update(size_t index, T value) { _Update(1, 0, size - 1, index, value); }
  void _Update(size_t vertex, size_t t_left, size_t t_right, size_t index,
               T value) {
    if (t_left == t_right) {
      tree[vertex] = value;
    } else {
      size_t t_middle = (t_left + t_right) >> 1;
      if (index <= t_middle) {
        _Update(vertex * 2, t_left, t_middle, index, value);
      } else {
        _Update(vertex * 2 + 1, t_middle + 1, t_right, index, value);
      }
      tree[vertex] = binary_function(tree[vertex * 2], tree[vertex * 2 + 1]);
    }
  }
};
template <class T>
const T sum(const T& lhs, const T& rhs) {
  return lhs + rhs;
}
void YES() { std::cout << "YES\n"; }
void NO() { std::cout << "NO\n"; }
std::map<int64_t, int> get_primes(int64_t x) {
  int64_t x_ = x;
  std::map<int64_t, int> map;
  while (x % 2 == 0) {
    map[2]++;
    x >>= 1;
  }
  for (int64_t d = 2; d * d <= x_; ++d) {
  }
}
void foo() { std::cout << ":(\n"; }
class Solver {
 public:
  int z;
  std::map<char, int> map;
  Solver() = default;
  void solve() {
    int n, k;
    std::cin >> n >> k;
    auto x = ReadVector(k);
    std::vector<int> first(n, -1);
    std::vector<int> last(n, -1);
    for (int i = 0; i < k; ++i) {
      if (first[x[i] - 1] == -1) first[x[i] - 1] = i;
    }
    for (int i = k - 1; i >= 0; --i) {
      if (last[x[i] - 1] == -1) last[x[i] - 1] = i;
    }
    int64_t count = 0;
    for (int i = 0; i < n; ++i) {
      if (first[i] == -1) count++;
      if (i == 0) continue;
      if (first[i - 1] == -1 || first[i] == -1) {
        count += 2;
        continue;
      }
      if (first[i - 1] > last[i]) count++;
      if (first[i] > last[i - 1]) count++;
    }
    int64_t answer = count;
    std::cout << answer << std::endl;
  }
};
int main(int argc, char** argv) {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  Solver solver;
  solver.solve();
  return 0;
}
