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 Edge {
  int next, to, w;
} ed[1000000 + 5];
struct egde {
  int u, v;
} e[1000000 + 5];
int mx = 0, ans = 0, fsdep[1000000 + 5], scdep[1000000 + 5], scpos[1000000 + 5],
    fspos[1000000 + 5], c1[1000000 + 5], c2[1000000 + 5], fc[1000000 + 5],
    delta[1000000 + 5], last[1000000 + 5], ecnt = 0, father[1000000 + 5], n, m,
    cnt = 0, ff[1000000 + 5];
bool vis[1000000 + 5], mark[1000000 + 5];
vector<int> p[1000000 + 5];
inline int f(int x) { return father[x] == x ? x : father[x] = f(father[x]); }
void add(int u, int v, int w) {
  ed[++ecnt].to = v, ed[ecnt].next = last[u], ed[ecnt].w = w, last[u] = ecnt;
  ed[++ecnt].to = u, ed[ecnt].next = last[v], ed[ecnt].w = w, last[v] = ecnt;
}
void dfs(int u, int fa) {
  fsdep[u] = scdep[u] = -1e9;
  father[u] = u;
  if (mark[u]) fsdep[u] = scdep[u] = 0;
  for (int i = last[u]; i; i = ed[i].next) {
    int v = ed[i].to;
    if (v == fa) continue;
    ff[v] = u;
    dfs(v, u);
    if (fsdep[v] + ed[i].w > fsdep[u])
      scdep[u] = fsdep[u], scpos[u] = fspos[u], fsdep[u] = fsdep[v] + ed[i].w,
      fspos[u] = v;
    else if (fsdep[v] + ed[i].w > scdep[u])
      scdep[u] = fsdep[v] + ed[i].w, scpos[u] = v;
  }
  if (mark[u]) fc[u] = u;
  for (int i = last[u]; i; i = ed[i].next) {
    int v = ed[i].to;
    if (v == fa) continue;
    if (fsdep[v] + ed[i].w == fsdep[u]) {
      if (!c1[u])
        fc[u] = fc[v];
      else
        fc[u] = u;
      c1[u]++;
    }
    if (fsdep[v] + ed[i].w == scdep[u]) c2[u]++;
  }
}
void dfs2(int u, int fa, int now, int pos) {
  if (mark[u]) {
    if (now > fsdep[u]) e[++cnt].u = u, e[cnt].v = pos;
    if (now < fsdep[u]) e[++cnt].u = u, e[cnt].v = fc[u];
  }
  for (int i = last[u]; i; i = ed[i].next) {
    int v = ed[i].to, x, p;
    if (v == fa) continue;
    if (fsdep[v] + ed[i].w == fsdep[u]) {
      if (c1[u] == 1)
        x = scdep[u], p = c2[u] == 1 ? fc[scpos[u]] : u;
      else
        x = fsdep[u], p = c1[u] > 2 ? u : fc[scpos[u]];
    } else {
      x = fsdep[u];
      if (c1[u] == 1)
        p = fc[fspos[u]];
      else
        p = u;
    }
    if (now > x) dfs2(v, u, now + ed[i].w, pos);
    if (x > now) dfs2(v, u, x + ed[i].w, p);
    if (now == x) dfs2(v, u, x + ed[i].w, u);
  }
}
void dfs3(int u, int fa) {
  for (int i = last[u]; i; i = ed[i].next) {
    int v = ed[i].to;
    if (v == fa) continue;
    dfs3(v, u);
  }
  delta[u] += p[u].size();
  for (int i = 0; i < p[u].size(); i++)
    if (vis[p[u][i]]) {
      int x;
      if (u == e[p[u][i]].u)
        x = f(e[p[u][i]].v);
      else
        x = f(e[p[u][i]].u);
      delta[x]--, delta[ff[x]]--;
    } else
      vis[p[u][i]] = 1;
  father[u] = fa;
}
int getAns(int u, int fa) {
  int sum = delta[u];
  for (int i = last[u]; i; i = ed[i].next) {
    int v = ed[i].to;
    if (v == fa) continue;
    sum += getAns(v, u);
  }
  if (!mark[u]) {
    if (sum > mx) mx = sum, ans = 0;
    if (mx == sum) ans++;
  }
  return sum;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    mark[x] = 1;
  }
  for (int i = 1; i < n; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    add(u, v, w);
  }
  dfs(1, 0);
  dfs2(1, 0, -1e9, 0);
  for (int i = 1; i <= cnt; i++) {
    p[e[i].u].push_back(i), p[e[i].v].push_back(i);
  }
  dfs3(1, 0);
  getAns(1, 0);
  printf("%d %d\n", mx, ans);
  return 0;
}
