#include <bits/stdc++.h>
using namespace std;
struct hh {
  int p, w;
} mx[100005][4];
vector<hh> d[100005];
bool us[100005];
int fa[20][100005], dp[100005], sum[100005], ans1, ans2;
void up(hh x, int y, int w) {
  if (x.w == -1) return;
  x.w += w;
  if (x.w > mx[y][1].w) {
    mx[y][3] = mx[y][2];
    mx[y][2] = mx[y][1];
    mx[y][1] = x;
  } else if (x.w > mx[y][2].w) {
    mx[y][3] = mx[y][2];
    mx[y][2] = x;
  } else if (x.w > mx[y][3].w)
    mx[y][3] = x;
}
hh mg(int x, int a, int b) {
  return (hh){mx[x][a].w == mx[x][b].w ? x : mx[x][a].p, mx[x][a].w};
}
void dfs(int x, int f) {
  dp[x] = dp[f] + 1;
  fa[0][x] = f;
  if (us[x])
    for (int i = 1; i <= 3; ++i) mx[x][i] = (hh){x, 0};
  else
    for (int i = 1; i <= 3; ++i) mx[x][i] = (hh){x, -1};
  for (int i = 0; i < (int)d[x].size(); ++i) {
    int v = d[x][i].p;
    if (v == f) continue;
    dfs(v, x);
    up(mx[v][0], x, d[x][i].w);
  }
  mx[x][0] = mg(x, 1, 2);
}
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 Dfs(int x, int f) {
  mx[x][0] = mg(x, 1, 2);
  if (us[x]) {
    sum[x]++;
    sum[mx[x][0].p]++;
    int f = Lca(x, mx[x][0].p);
    sum[f]--;
    sum[fa[0][f]]--;
  }
  for (int i = 0; i < (int)d[x].size(); ++i) {
    int v = d[x][i].p;
    if (v == f) continue;
    if (mx[x][1].p == mx[v][0].p)
      up(mg(x, 2, 3), v, d[x][i].w);
    else if (mx[x][2].p == mx[v][0].p)
      up(mg(x, 1, 3), v, d[x][i].w);
    else
      up(mx[x][0], v, d[x][i].w);
    Dfs(v, x);
  }
}
void cl(int x, int f) {
  for (int i = 0; i < (int)d[x].size(); ++i) {
    int v = d[x][i].p;
    if (v == f) continue;
    cl(v, x);
    sum[x] += sum[v];
  }
  if (!us[x]) {
    if (sum[x] > ans1)
      ans1 = sum[x], ans2 = 1;
    else if (sum[x] == ans1)
      ans2++;
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1, x; i <= m; ++i) {
    scanf("%d", &x);
    us[x] = 1;
  }
  for (int i = 1, x, y, w; i < n; ++i) {
    scanf("%d%d%d", &x, &y, &w);
    d[x].push_back((hh){y, w});
    d[y].push_back((hh){x, w});
  }
  dfs(1, 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]];
  Dfs(1, 0);
  cl(1, 0);
  printf("%d %d\n", ans1, ans2);
}
