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>
const int N = 1e5 + 51;
struct edge {
  int to, next, w;
} e[N << 1];
int head[N], cnt;
void addedge(int x, int y, int z) {
  e[++cnt] = (edge){y, x[head], z}, x[head] = cnt;
  e[++cnt] = (edge){x, y[head], z}, y[head] = cnt;
}
int col[N], par[N], vis[N], pt, pv, ans, a2, mxdep;
std::vector<int> v;
void upd(int x) {
  if (x > ans) ans = x, a2 = 0;
  a2 += x == ans;
}
void dfs1(int x, int p, int d, int *arr) {
  x[par] = p, x[arr] = d;
  if (x[col] && d > pv) pv = d, pt = x;
  for (int i = x[head], nx; i; i = e[i].next)
    if ((nx = e[i].to) != p) dfs1(nx, x, d + e[i].w, arr);
}
int dfs2(int x, int p, int d) {
  if (x[col]) mxdep = std::max(mxdep, d);
  int c = x[col];
  for (int i = x[head], nx; i; i = e[i].next)
    if ((nx = e[i].to) != p && !nx[vis]) c += dfs2(nx, x, d + e[i].w);
  if (!x[col]) printf("[%d] = %d\n", x, c), upd(c);
  return c;
}
int n, x, y, z, s, t, disL[N], disR[N], L[N], R[N], sz[N], dep[N], sL, sR;
std::vector<int> lnk;
int main() {
  for (scanf("%d%d", &n, &x); x--;) scanf("%d", &y), y[col] = 1;
  for (int i = 1; i < n; i++) scanf("%d%d%d", &x, &y, &z), addedge(x, y, z);
  dfs1(1, 0, 0, disL), s = pt, pv = -1;
  dfs1(s, 0, 0, disL), t = pt, pv = -1;
  dfs1(t, 0, 0, disR);
  for (int i = s; i; i = i[par]) lnk.push_back(i), i[vis] = 1;
  for (int i : lnk) {
    mxdep = -1, i[sz] = dfs2(i, 0, 0), x[dep] = mxdep;
    if (x[dep] == i[disR]) break;
    if (i[disL] < i[disR]) i[R] += i[sz], sR += i[sz];
  }
  std::reverse(lnk.begin(), lnk.end());
  for (int i : lnk) {
    if (x[dep] == i[disL]) break;
    if (i[disL] > i[disR]) i[L] += i[sz];
  }
  for (int i : lnk) {
    sR -= i[R];
    if (!i[col]) upd(sL + sR + i[sz]);
    sL += i[L];
  }
  printf("%d %d", ans, a2);
}
