A tree is an undirected connected graph without cycles. The distance between two vertices is the number of edges in a simple path between them.

Limak is a little polar bear. He lives in a tree that consists of n vertices, numbered 1 through n.

Limak recently learned how to jump. He can jump from a vertex to any vertex within distance at most k.

For a pair of vertices (s, t) we define f(s, t) as the minimum number of jumps Limak needs to get from s to t. Your task is to find the sum of f(s, t) over all pairs of vertices (s, t) such that s < t.

Input

The first line of the input contains two integers n and k (2 ≤ n ≤ 200 000, 1 ≤ k ≤ 5) — the number of vertices in the tree and the maximum allowed jump distance respectively.

The next n - 1 lines describe edges in the tree. The i-th of those lines contains two integers ai and bi (1 ≤ ai, bi ≤ n) — the indices on vertices connected with i-th edge.

It's guaranteed that the given edges form a tree.

Output

Print one integer, denoting the sum of f(s, t) over all pairs of vertices (s, t) such that s < t.

Examples

Input

6 2
1 2
1 3
2 4
2 5
4 6


Output

20


Input

13 3
1 2
3 2
4 2
5 2
3 6
10 6
6 7
6 13
5 8
5 9
9 11
11 12


Output

114


Input

3 5
2 1
3 1


Output

3

Note

In the first sample, the given tree has 6 vertices and it's displayed on the drawing below. Limak can jump to any vertex within distance at most 2. For example, from the vertex 5 he can jump to any of vertices: 1, 2 and 4 (well, he can also jump to the vertex 5 itself).

<image>

There are <image> pairs of vertices (s, t) such that s < t. For 5 of those pairs Limak would need two jumps: (1, 6), (3, 4), (3, 5), (3, 6), (5, 6). For other 10 pairs one jump is enough. So, the answer is 5·2 + 10·1 = 20.

In the third sample, Limak can jump between every two vertices directly. There are 3 pairs of vertices (s < t), so the answer is 3·1 = 3.
#include <bits/stdc++.h>
using namespace std;
struct ofl {
  long double value;
  int precision;
  inline ofl(long double value, int precision)
      : value(value), precision(precision) {}
};
const int seed = hash<string>()("alex256");
const int inf = (int)1e9 + 7;
const int64_t llInf = (int64_t)2e18 + 256;
const int mod = (int)1e9 + 7;
const long double pi = 3.141592653589793238462643383279502884197169399375105821;
const string luck = "🍀";
const char* errText = "error :(";
template <typename T1, typename T2>
inline istream& operator>>(istream& is, pair<T1, T2>& p) {
  return is >> p.first >> p.second;
}
template <typename T1, typename T2>
inline ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << p.first << " " << p.second;
}
template <typename T>
inline istream& operator>>(istream& is, vector<T>& v) {
  for (int i = 0; i < (int)(v.size()); i++) {
    is >> v[i];
  }
  return is;
}
template <typename T>
inline ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = 0; i < (int)(v.size()); i++) {
    if (i) {
      os << " ";
    }
    os << v[i];
  }
  return os;
}
inline ostream& operator<<(ostream& os, const ofl& o) {
  return os << fixed << setprecision(o.precision) << o.value;
}
inline bool iosOptimize() {
  ios_base::sync_with_stdio(false);
  return true;
}
bool iosOptimized = iosOptimize();
template <typename T>
inline T get() {
  T value;
  cin >> value;
  return value;
}
template <>
inline char get() {
  char c = '\0';
  while (c <= ' ') {
    cin >> c;
  }
  return c;
}
inline string getLn() {
  string s;
  getline(cin, s);
  return s;
}
template <typename T, size_t Count>
struct VectorPacker {};
template <typename T>
struct VectorPacker<T, 0> {};
template <typename T>
inline vector<T> getVector(int size) {
  vector<T> res(size);
  cin >> res;
  return res;
}
template <typename T, typename U, typename... Args>
inline typename VectorPacker<T, sizeof...(Args) + 1>::T getVector(
    U size, Args... sizes) {
  typename VectorPacker<T, sizeof...(Args) + 1>::T res(size);
  for (int i = 0; i < (int)size; i++) {
    res[i] = getVector<T>(sizes...);
  }
  return res;
}
inline void put() {}
template <typename T, typename... Args>
inline void put(const T& value, const Args&... vals) {
  cout << value;
  put(vals...);
}
template <typename... Args>
inline void putLn(const Args&... vals) {
  put(vals...);
  cout << "\n";
}
namespace std {
template <typename T1, typename T2>
struct hash<pair<T1, T2> > {
  inline size_t operator()(const pair<T1, T2>& p) const {
    return hash<T1>()(p.first) ^ hash<T2>()(p.second);
  }
};
};  // namespace std
mt19937_64 rnd(seed);
inline void error(const char* text = errText) {
  ;
  exit(256);
}
template <typename T1, typename T2>
inline void umax(T1& a, const T2& b) {
  if (a < b) {
    a = b;
  }
}
template <typename T1, typename T2>
inline void umin(T1& a, const T2& b) {
  if (a > b) {
    a = b;
  }
}
int64_t gcd(int64_t a, int64_t b) { return b ? gcd(b, a % b) : a; }
int64_t extGcd(int64_t a, int64_t b, int64_t& x, int64_t& y) {
  if (!a) {
    x = 0;
    y = 1;
    return b;
  }
  int64_t x1, y1, d = extGcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
inline int addMod(int a, int b, int m = mod) { return ((int64_t)a + b) % m; }
inline int subMod(int a, int b, int m = mod) {
  return ((int64_t)a + m - b) % m;
}
inline int mulMod(int a, int b, int m = mod) { return ((int64_t)a * b) % m; }
inline int divMod(int a, int b, int m = mod) {
  int64_t x, y;
  int64_t g = extGcd(b, m, x, y);
  if (g != 1) {
    ;
    exit(42);
  }
  x = (x % m + m) % m;
  return mulMod(a, x, m);
}
int n = get<int>(), k = get<int>();
vector<vector<int> > g(n);
int64_t dp[300000][5];
int64_t sz[300000][5];
int64_t ans = 0;
void dfs(int v, int p = -1) {
  for (int to : g[v]) {
    if (to == p) {
      continue;
    }
    dfs(to, v);
    for (int i = 0; i < k; i++) {
      int mul = (i) / k + 1;
      ans += dp[to][i] + mul * sz[to][i];
    }
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < k; j++) {
        int mul = (i + j) / k + 1;
        ans += dp[to][i] * sz[v][j];
        ans += dp[v][j] * sz[to][i];
        ans += mul * sz[v][j] * sz[to][i];
      }
    }
    for (int i = 1; i < k; i++) {
      dp[v][i] += dp[to][i - 1];
      sz[v][i] += sz[to][i - 1];
    }
    dp[v][0] += sz[to][k - 1] + dp[to][k - 1];
    sz[v][0] += sz[to][k - 1];
  }
  sz[v][0]++;
}
signed main() {
  for (int i = 1; i < n; i++) {
    int a = get<int>() - 1, b = get<int>() - 1;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0);
  cout << ans << "\n";
  return 0;
}
