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;
} 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);
}
