7 3
1 4 7
1 2 2
2 3 3
3 4 8
2 5 1
1 6 4
6 7 5
 10 2
1 5
5 3 2
8 4 8
7 6 9
7 10 1
10 1 4
9 5 1
5 8 2
7 2 9
6 5 6
 10 5
4 8 7 5 1
5 1 1
2 7 1
4 3 1
10 9 1
10 1 1
1 8 1
10 7 1
10 3 1
7 6 1
 10 9
9 7 6 10 3 5 2 8 1
9 4 10
10 8 3
3 6 2
5 1 8
5 2 5
1 10 10
6 7 1
9 1 7
1 6 3
 10 5
8 5 2 10 1
3 1 7
5 4 6
10 8 4
6 8 9
7 8 4
9 5 6
8 1 9
2 10 2
9 8 7

3 2
 2 3
 5 1
 0 1
 5 1

#include <bits/stdc++.h>
using namespace std;
const int N = 100007, oo = 1000000000;
int n, m, t, d, ans, cnt, hd[N], nt[N << 1], to[N << 1], go[N << 1], dl[N << 1],
    A[N], E[N], B[N], F[N], G[N], H[N], P[N], Q[N], T[N];
namespace cake {
int D[N], fa[N], tf[N], p, q;
void fly(int u) {
  if (D[u] > D[p]) p = u;
  for (int i = hd[u]; i; i = nt[i])
    if (to[i] != fa[u] && !dl[(i + 1) / 2]) {
      D[to[i]] = D[u] + go[i];
      fa[to[i]] = u, tf[to[i]] = go[i];
      fly(to[i]);
    }
}
void walk(int u) {
  if (B[u]) tf[u] = 1;
  for (int i = hd[u]; i; i = nt[i])
    if (to[i] != fa[u]) {
      fa[to[i]] = u;
      walk(to[i]);
      tf[u] += tf[to[i]];
      if (!tf[to[i]]) dl[(i + 1) / 2] = 1;
    }
}
void make() {
  int r;
  for (int i = 1; i <= n; ++i)
    if (B[i]) r = i;
  walk(r);
  p = r, tf[r] = fa[r] = D[r] = 0, fly(r);
  q = p, tf[p] = fa[p] = D[p] = 0, fly(p);
  for (;;) {
    A[++t] = p, E[t] = tf[p];
    if (p == q) break;
    p = fa[p];
  }
}
}  // namespace cake
void fly(int u, int f) {
  if (B[u]) T[u] = 1;
  for (int i = hd[u]; i; i = nt[i])
    if (to[i] != f && !dl[(i + 1) / 2]) {
      fly(to[i], u);
      T[u] += T[to[i]];
    }
}
void dig(int u, int f, int x) {
  d = max(d, x);
  for (int i = hd[u]; i; i = nt[i])
    if (to[i] != f && !dl[(i + 1) / 2]) dig(to[i], u, x + go[i]);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int x;
    scanf("%d", &x);
    B[x] = 1;
  }
  for (int i = 1; i <= n - 1; ++i) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    nt[i * 2 - 1] = hd[x], hd[x] = i * 2 - 1, to[i * 2 - 1] = y,
               go[i * 2 - 1] = z;
    nt[i * 2] = hd[y], hd[y] = i * 2, to[i * 2] = x, go[i * 2] = z;
  }
  cake::make();
  for (int i = 2; i <= t; ++i) F[i] = F[i - 1] + E[i - 1];
  for (int i = t - 1; i >= 1; --i) G[i] = G[i + 1] + E[i];
  for (int i = 1; i <= t; ++i) {
    for (int j = hd[A[i]]; j; j = nt[j])
      if (to[j] != A[i - 1] && to[j] != A[i + 1]) {
        d = 0, dig(to[j], A[i], 1);
        if (d == min(F[i], G[i])) H[i] = 1;
      }
  }
  for (int i = 1; i <= t; ++i)
    if (F[i] < G[i]) {
      int s = 0;
      for (int j = hd[A[i]]; j; j = nt[j])
        if (to[j] != A[i - 1] && to[j] != A[i + 1]) {
          fly(to[j], A[i]);
          s += T[to[j]];
        }
      P[i] += s + B[A[i]];
    } else
      break;
  for (int i = 1; i <= t; ++i) {
    if (F[i - 1] < G[i - 1] || !H[i - 1]) P[i] += P[i - 1];
    T[A[i]] += P[i];
  }
  for (int i = t; i >= 1; --i)
    if (G[i] < F[i]) {
      int s = 0;
      for (int j = hd[A[i]]; j; j = nt[j])
        if (to[j] != A[i - 1] && to[j] != A[i + 1]) {
          fly(to[j], A[i]);
          s += T[to[j]];
        }
      Q[i] += s + B[A[i]];
    } else
      break;
  for (int i = 1; i <= t; ++i)
    if (F[i] == G[i]) {
      int s = 0;
      for (int j = hd[A[i]]; j; j = nt[j])
        if (to[j] != A[i - 1] && to[j] != A[i + 1]) {
          fly(to[j], A[i]);
          s += T[to[j]];
        }
      T[A[i]] += s + B[A[i]];
    }
  for (int i = t; i >= 1; --i) {
    if (G[i + 1] < F[i + 1] || !H[i + 1]) Q[i] += Q[i + 1];
    T[A[i]] += Q[i];
  }
  for (int i = 1; i <= n; ++i) {
    if (B[i]) continue;
    if (T[i] > ans)
      ans = T[i], cnt = 1;
    else if (T[i] == ans)
      ++cnt;
  }
  printf("%d %d\n", ans, cnt);
  return 0;
}
