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;
struct hh {
  int p, w;
};
vector<hh> d[100005];
int sl1[100005], sl2[100005], xg1[100005], xg2[100005], fa[20][100005],
    dp[100005], mx1[100005], mx2[100005], sum[100005], ans, sz;
bool mk[100005];
void dfs1(int x, int f) {
  fa[0][x] = f;
  dp[x] = dp[f] + 1;
  if (mk[x]) mx1[x] = 0;
  for (int i = 0; i < (int)d[x].size(); ++i) {
    int v = d[x][i].p;
    if (v == f) continue;
    dfs1(v, x);
    if (mx1[v] == -1) continue;
    if (mx1[v] + d[x][i].w > mx1[x])
      sl2[x] = sl1[x], xg2[x] = xg1[x], sl1[x] = 1, xg1[x] = xg1[v];
    else if (mx1[v] + d[x][i].w == mx1[x])
      sl1[x]++, xg1[x] = xg1[v];
    else if (mx1[v] + d[x][i].w > mx2[x])
      sl2[x] = 1, xg2[x] = xg1[v];
    else if (mx1[v] + d[x][i].w == mx2[x])
      sl2[x]++, xg2[x] = xg1[v];
    if (mx1[v] + d[x][i].w > mx1[x])
      mx2[x] = mx1[x], mx1[x] = mx1[v] + d[x][i].w;
    else if (mx1[v] + d[x][i].w > mx2[x])
      mx2[x] = mx1[v] + d[x][i].w;
  }
  if (sl1[x] != 1) xg1[x] = x;
  if (sl2[x] != 1) xg2[x] = x;
}
void dfs2(int x, int f, int w) {
  if (f && mx1[f] != -1) {
    int v, p;
    bool o = 0;
    if (mx1[x] + w == mx1[f] && sl1[f] == 1) {
      if (mx2[f] == -1) o = 1;
      v = mx2[f] + w, p = xg2[f];
    } else
      v = mx1[f] + w, p = xg1[f];
    if (!o) {
      if (v > mx1[x])
        sl1[x] = 1, xg1[x] = p;
      else if (v == mx1[x])
        sl1[x]++, xg1[x] = p;
      else if (v > mx2[x])
        sl2[x] = 1, xg2[x] = p;
      else if (v == mx2[x])
        sl2[x]++, xg2[x] = p;
      if (v > mx1[x])
        mx2[x] = mx1[x], mx1[x] = v;
      else if (v > mx2[x])
        mx2[x] = v;
    }
  }
  if (sl1[x] != 1) xg1[x] = x;
  if (sl2[x] != 1) xg2[x] = x;
  for (int i = 0; i < (int)d[x].size(); ++i) {
    int v = d[x][i].p;
    if (v == f) continue;
    dfs2(v, x, d[x][i].w);
  }
}
int Lca(int x, int y) {
  if (dp[x] < dp[y]) swap(x, y);
  for (int i = 16; i >= 0; --i)
    if (dp[fa[i][x]] >= dp[y]) x = fa[i][x];
  if (x == y) return x;
  for (int i = 16; i >= 0; --i)
    if (fa[i][x] != fa[i][y]) x = fa[i][x], y = fa[i][y];
  return fa[0][x];
}
void dfs3(int x, int f) {
  for (int i = 0; i < (int)d[x].size(); ++i) {
    int v = d[x][i].p;
    if (v == f) continue;
    dfs3(v, x);
    sum[x] += sum[v];
  }
  if (!mk[x]) {
    if (sum[x] > ans)
      ans = sum[x], sz = 1;
    else if (sum[x] == ans)
      sz++;
  }
}
int main() {
  int n, m;
  memset(mx1, -1, sizeof(mx1));
  memset(mx2, -1, sizeof(mx2));
  scanf("%d%d", &n, &m);
  for (int i = 1, x; i <= m; ++i) {
    scanf("%d", &x);
    mk[x] = 1;
  }
  for (int i = 1, a, b, c; i < n; ++i) {
    scanf("%d%d%d", &a, &b, &c);
    d[a].push_back((hh){b, c});
    d[b].push_back((hh){a, c});
  }
  dfs1(1, 0);
  dfs2(1, 0, 0);
  for (int i = 1; i <= 16; ++i)
    for (int j = 1; j <= n; ++j) fa[i][j] = fa[i - 1][fa[i - 1][j]];
  for (int i = 1; i <= n; ++i)
    if (mk[i]) {
      sum[i]++, sum[xg1[i]]++;
      int lca = Lca(i, xg1[i]);
      sum[lca]--;
      sum[fa[0][lca]]--;
    }
  dfs3(1, 0);
  printf("%d %d", ans, sz);
}
