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 maxn = 100111;
vector<int> g[maxn], l[maxn];
int n, m, f[maxn];
bool have[maxn];
int down[maxn], down_id[maxn], coef[maxn];
int up[maxn], up_id[maxn], up_mid[maxn];
void dfs(int x, int fa) {
  f[x] = fa;
  for (int i = 0; i < (int)g[x].size(); i++)
    if (g[x][i] != fa) {
      dfs(g[x][i], x);
      if (down[g[x][i]] == -1) continue;
      if (down[g[x][i]] + l[x][i] > down[x]) {
        down[x] = down[g[x][i]] + l[x][i];
        down_id[x] = down_id[g[x][i]];
      } else if (down[g[x][i]] + l[x][i] == down[x])
        down_id[x] = x;
    }
}
void dfs2(int x) {
  if (have[x]) {
    if (up[x] < down[x]) {
      coef[down_id[x]]++;
      coef[f[x]]--;
    } else if (up[x] > down[x]) {
      coef[x]++;
      coef[up_id[x]]++;
      coef[up_mid[x]]--;
      coef[f[up_mid[x]]]--;
    }
  }
  int cur_up, cur_id, cur_mid;
  cur_up = up[x];
  cur_id = up_id[x];
  cur_mid = up_mid[x];
  for (int i = 0; i < (int)g[x].size(); i++)
    if (g[x][i] != f[x]) {
      if (down[g[x][i]] == -1) continue;
      if (cur_up != -1) {
        up[g[x][i]] = cur_up + l[x][i];
        up_id[g[x][i]] = cur_id;
        up_mid[g[x][i]] = cur_mid;
      }
      if (down[g[x][i]] + l[x][i] > cur_up) {
        cur_up = down[g[x][i]] + l[x][i];
        cur_id = down_id[g[x][i]];
        cur_mid = x;
      } else if (down[g[x][i]] + l[x][i] == cur_up)
        cur_id = cur_mid = x;
    }
  cur_up = cur_id = cur_mid = -1;
  for (int i = (int)g[x].size() - 1; i >= 0; i--)
    if (g[x][i] != f[x]) {
      if (down[g[x][i]] == -1) continue;
      if (cur_up != -1) {
        if (cur_up + l[x][i] > up[g[x][i]]) {
          up[g[x][i]] = cur_up + l[x][i];
          up_id[g[x][i]] = cur_id;
          up_mid[g[x][i]] = cur_mid;
        } else if (cur_up + l[x][i] == up[g[x][i]])
          up_id[g[x][i]] = up_mid[g[x][i]] = x;
      }
      if (down[g[x][i]] + l[x][i] > cur_up) {
        cur_up = down[g[x][i]] + l[x][i];
        cur_id = down_id[g[x][i]];
        cur_mid = x;
      } else if (down[g[x][i]] + l[x][i] == cur_up)
        cur_id = cur_mid = x;
      dfs2(g[x][i]);
    }
}
void dfs3(int x) {
  for (int i = 0; i < (int)g[x].size(); i++)
    if (g[x][i] != f[x]) {
      dfs3(g[x][i]);
      coef[x] += coef[g[x][i]];
    }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    have[x] = 1;
  }
  for (int i = 1, u, v, w; i < n; i++) {
    scanf("%d%d%d", &u, &v, &w);
    g[u].push_back(v);
    l[u].push_back(w);
    g[v].push_back(u);
    l[v].push_back(w);
  }
  for (int x = 1; x <= n; x++) {
    if (have[x]) {
      up[x] = down[x] = 0;
      up_id[x] = down_id[x] = up_mid[x] = x;
    } else
      up[x] = down[x] = up_id[x] = down_id[x] = up_mid[x] = -1;
  }
  dfs(1, 0);
  dfs2(1);
  dfs3(1);
  int mx = 0, cnt = 0;
  for (int i = 1; i <= n; i++)
    if (!have[i]) mx = max(mx, coef[i]);
  for (int i = 1; i <= n; i++)
    if (!have[i] && coef[i] == mx) cnt++;
  printf("%d %d\n", mx, cnt);
  return 0;
}
