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>
std::vector<std::pair<int, int> > node[131072];
int h1[131072], h2[131072], c1[131072], cen, rad = ((int)1e9);
int f[131072], w[131072], ans, cnt;
void count(int p, int u) {
  h1[u] = h2[u] = 0;
  w[u] = f[u];
  for (auto it : node[u]) {
    int &v = it.first, &c = it.second;
    if (p == v) continue;
    count(u, v);
    int h = h1[v] + c;
    if (h > h1[u])
      h2[u] = h1[u], h1[u] = h, c1[u] = v;
    else if (h > h2[u])
      h2[u] = h;
    w[u] += w[v];
  }
}
void findCenter(int p, int u, int dis) {
  int r = std::max(dis, h1[u]);
  if (r < rad) rad = r, cen = u;
  for (auto it : node[u]) {
    int &v = it.first, &c = it.second;
    if (p == v) continue;
    findCenter(u, v, std::max(dis, c1[u] == v ? h2[u] : h1[u]) + c);
  }
}
void dfs(int p, int u, int sw) {
  if (!f[u]) {
    int k = w[u] + sw;
    if (k > ans)
      ans = k, cnt = 1;
    else if (k == ans)
      ++cnt;
  }
  for (auto it : node[u]) {
    int &v = it.first;
    if (p == v) continue;
    dfs(u, v, (c1[u] == v && h1[u] != h2[u]) ? sw : 0);
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int k;
    scanf("%d", &k);
    f[k] = 1;
  }
  for (int i = 1; i < n; ++i) {
    int u, v, c;
    scanf("%d%d%d", &u, &v, &c);
    node[u].push_back(std::pair<int, int>(v, c));
    node[v].push_back(std::pair<int, int>(u, c));
  }
  count(1, 1);
  findCenter(1, 1, 0);
  count(cen, cen);
  int ch1 = 0, ch2 = 0, ch3 = 0, cc1 = -1, cc2 = -1;
  for (auto it : node[cen]) {
    int &v = it.first, &c = it.second;
    int h = h1[v] + c;
    if (h > ch1)
      ch3 = ch2, ch2 = ch1, ch1 = h, cc2 = cc1, cc1 = v;
    else if (h > ch2)
      ch3 = ch2, ch2 = h, cc2 = v;
    else if (h > ch3)
      ch3 = h;
  }
  if (!f[cen]) ans = w[cen], cnt = 1;
  for (auto it : node[cen]) {
    int &v = it.first;
    if (v == cc1)
      dfs(cen, v, ch1 != ch2 ? w[cen] - w[v] : ch1 != ch3 ? w[cc2] : 0);
    else if (v == cc2)
      dfs(cen, v, ch2 != ch3 ? w[cc1] : 0);
    else
      dfs(cen, v, 0);
  }
  printf("%d %d\n", ans, cnt);
  return 0;
}
