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 = 1e5 + 5;
int n, m, h[N], ma, rs, pre[N], Dp[N], tp[N], sn[N], sz[N], nu[N], f[N], df;
bool v[N];
void R(int &x) {
  x = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
}
struct E {
  int l, to, w;
} e[N << 1];
struct P {
  int w, p;
} w[4][N];
void Nw(int x, P y, int e) {
  if (y.w == -1) return;
  y.w += e;
  if (y.w > w[1][x].w) {
    w[3][x] = w[2][x];
    w[2][x] = w[1][x];
    w[1][x] = y;
  } else if (y.w > w[2][x].w) {
    w[3][x] = w[2][x];
    w[2][x] = y;
  } else if (y.w > w[3][x].w)
    w[3][x] = y;
}
P Mg(int x, int a, int b) {
  return (P){w[a][x].w, (w[a][x].w == w[b][x].w) ? x : w[a][x].p};
}
void se(int x) {
  sz[x] = 1;
  nu[++df] = x;
  if (v[x]) {
    w[1][x] = w[2][x] = w[3][x] = (P){0, x};
  } else
    w[1][x].w = w[2][x].w = w[3][x].w = -1;
  for (int i = h[x]; i; i = e[i].l) {
    int to = e[i].to;
    if (to == f[x]) continue;
    f[to] = x;
    Dp[to] = Dp[x] + 1;
    se(to);
    sz[x] += sz[to];
    if (sz[to] > sz[sn[x]]) sn[x] = to;
    Nw(x, w[0][to], e[i].w);
  }
  w[0][x] = Mg(x, 1, 2);
}
int lca(int x, int y) {
  while (tp[x] != tp[y]) (Dp[tp[x]] < Dp[tp[y]]) ? y = f[tp[y]] : x = f[tp[x]];
  return Dp[x] < Dp[y] ? x : y;
}
void dfs(int x) {
  w[0][x] = Mg(x, 1, 2);
  if (v[x]) {
    int y = w[0][x].p, g = lca(x, y);
    pre[x]++;
    pre[y]++;
    pre[g]--;
    pre[f[g]]--;
  }
  for (int i = h[x]; i; i = e[i].l) {
    int to = e[i].to;
    if (to == f[x] || w[1][to].w == -1) continue;
    if (w[0][to].p == w[1][x].p)
      Nw(to, Mg(x, 2, 3), e[i].w);
    else if (w[0][to].p == w[2][x].p)
      Nw(to, Mg(x, 1, 3), e[i].w);
    else
      Nw(to, w[0][x], e[i].w);
    dfs(to);
  }
}
int main() {
  int x, y, w;
  R(n);
  R(m);
  for (int i = 1; i <= m; ++i) {
    R(x);
    v[x] = 1;
  }
  for (int i = 1; i < n; ++i) {
    R(x);
    R(y);
    R(w);
    e[i << 1].to = x;
    e[i << 1].l = h[y];
    h[y] = i << 1;
    e[i << 1 | 1].to = y;
    e[i << 1 | 1].l = h[x];
    h[x] = i << 1 | 1;
    e[i << 1].w = e[i << 1 | 1].w = w;
  }
  se(1);
  tp[1] = 1;
  for (int i = 2; i <= n; ++i)
    tp[nu[i]] = (sn[f[nu[i]]] == nu[i]) ? tp[f[nu[i]]] : nu[i];
  dfs(1);
  for (int i = n; i; i--) {
    pre[f[nu[i]]] += pre[nu[i]];
    if (v[nu[i]]) continue;
    if (pre[nu[i]] > ma) {
      ma = pre[nu[i]];
      rs = 1;
    } else if (pre[nu[i]] == ma)
      rs++;
  }
  printf("%d %d\n", ma, rs);
  return 0;
}
