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 N = 100010;
const int inf = -(int)(1e9);
struct E {
  int v, c;
  E(int _v, int _c) {
    v = _v;
    c = _c;
  }
};
vector<E> e[N];
int n, m;
int a[N], s[N];
int f[N][2], g[N][3], fa[N], w[N];
void dfs1(int fu, int u) {
  int i, v, c;
  int y = -1;
  fa[u] = fu;
  if (a[u]) {
    f[u][0] = 0;
    y = u;
  } else
    f[u][0] = inf;
  for (i = 0; i < e[u].size(); i++) {
    v = e[u][i].v;
    if (v == fu) continue;
    dfs1(u, v);
    c = e[u][i].c;
    w[v] = c;
    if (f[v][0] + c > f[u][0]) {
      f[u][0] = f[v][0] + c;
      y = f[v][1];
    } else if (f[v][0] + c == f[u][0])
      y = u;
  }
  f[u][1] = y;
}
void dfs2(int fu, int u) {
  int i, v, c;
  if (fu) {
    g[u][0] = g[fu][0] + w[u];
    g[u][1] = g[fu][1];
    g[u][2] = g[fu][2];
    for (i = 0; i < e[fu].size(); i++) {
      v = e[fu][i].v;
      if (u == v || v == fa[fu]) continue;
      int tmp = w[u] + w[v] + f[v][0];
      if (tmp > g[u][0]) {
        g[u][0] = tmp;
        g[u][1] = fu;
        g[u][2] = f[v][1];
      } else if (tmp == g[u][0]) {
        g[u][1] = fu;
        g[u][2] = fu;
      }
    }
  }
  for (i = 0; i < e[u].size(); i++) {
    v = e[u][i].v;
    if (v == fu) continue;
    dfs2(u, v);
  }
}
void dfs3(int fu, int u) {
  int i, v;
  for (i = 0; i < e[u].size(); i++) {
    v = e[u][i].v;
    if (v == fu) continue;
    dfs3(u, v);
    s[u] += s[v];
  }
}
int main() {
  int i, u, v, c;
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &u);
    a[u] = 1;
  }
  for (i = 1; i < n; i++) {
    scanf("%d%d%d", &u, &v, &c);
    e[u].push_back(E(v, c));
    e[v].push_back(E(u, c));
  }
  dfs1(0, 1);
  dfs2(0, 1);
  for (i = 1; i <= n; i++) {
    if (a[i] && f[i][0] != g[i][0]) {
      if (f[i][0] > g[i][0]) {
        s[fa[i]]--;
        s[f[i][1]]++;
      } else {
        s[i]++;
        s[g[i][1]]--;
        s[fa[g[i][1]]]--;
        s[g[i][2]]++;
      }
    }
  }
  dfs3(0, 1);
  int x = inf, y = 0;
  for (i = 1; i <= n; i++) {
    if (a[i]) continue;
    if (s[i] > x) {
      x = s[i];
      y = 1;
    } else if (s[i] == x)
      y++;
  }
  printf("%d %d\n", x, y);
  return 0;
}
