#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;
int n, m;
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);
    if (!w[v]) continue;
    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,
               w[v] == m ? 0 : 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() {
  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;
}
