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;
int fro[2000005], dep[2000005], maxx[2000005], top[2000005], dis[2000005], ans,
    ans1, inf = 1e9, vis[2000005], mx = inf, rt, siz[2000005], num, qwq, n, m,
          num1[2000005];
vector<pair<int, int> > vec[2000005];
void dfs(int x, int fa) {
  dis[x] = fro[x] = -inf;
  if (vis[x]) dis[x] = 0;
  for (int i = 0; i < vec[x].size(); i++) {
    int y = vec[x][i].first;
    if (y == fa) continue;
    dfs(y, x);
    if (dis[y] + vec[x][i].second > dis[x])
      fro[x] = dis[x], dis[x] = dis[y] + vec[x][i].second;
    else if (dis[y] + vec[x][i].second > fro[x])
      fro[x] = dis[y] + vec[x][i].second;
  }
}
void dfs1(int x, int fa, int pre) {
  maxx[x] = max(dis[x], pre);
  for (int i = 0; i < vec[x].size(); i++) {
    int y = vec[x][i].first;
    if (y == fa) continue;
    if (dis[y] + vec[x][i].second == dis[x])
      dfs1(y, x, max(fro[x], pre) + vec[x][i].second);
    else
      dfs1(y, x, max(dis[x], pre) + vec[x][i].second);
  }
  if (maxx[x] < mx) mx = maxx[x], rt = x;
}
void dfs2(int x, int fa, int tp) {
  dis[x] = fro[x] = -inf;
  if (tp) top[x] = tp;
  if (vis[x]) siz[x] = 1, dis[x] = 0, num1[x] = 1;
  for (int i = 0; i < vec[x].size(); i++) {
    int y = vec[x][i].first;
    if (y == fa) continue;
    dep[y] = dep[x] + vec[x][i].second;
    dfs2(y, x, (!tp) ? y : tp);
    if (dis[y] + vec[x][i].second == dis[x]) {
      if (x == rt) num += siz[y], qwq++;
      num1[x] += num1[y];
    } else if (dis[y] + vec[x][i].second > dis[x]) {
      fro[x] = dis[x];
      dis[x] = dis[y] + vec[x][i].second;
      if (x == rt) qwq = 1, num = siz[y];
      num1[x] = num1[y];
    } else if (dis[y] + vec[x][i].second > fro[x]) {
      fro[x] = dis[y] + vec[x][i].second;
    }
    siz[x] += siz[y];
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    vis[x] = 1;
  }
  maxx[0] = fro[0] = -inf;
  for (int i = 1; i < n; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    vec[x].push_back(make_pair(y, z));
    vec[y].push_back(make_pair(x, z));
  }
  dfs(1, 0);
  dfs1(1, 0, vis[1] ? 0 : -inf);
  memset(fro, 0, sizeof(fro));
  memset(dis, 0, sizeof(dis));
  dfs2(rt, 0, 0);
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      int x = top[i];
      if (i == rt) {
        if (siz[i] > ans)
          ans = siz[i], ans1 = 1;
        else if (siz[i] == ans)
          ans1++;
      } else if (dis[i] + dep[i] - dep[x] == dis[x] && num1[i] == num1[x]) {
        if (qwq >= 3) {
          if (siz[i] > ans)
            ans = siz[i], ans1 = 1;
          else if (siz[i] == ans)
            ans1++;
        } else if (qwq == 2) {
          if (dep[x] + dis[x] == dis[rt]) {
            if (siz[i] + num - siz[x] > ans)
              ans = siz[i] + num - siz[x], ans1 = 1;
            else if (siz[i] + num - siz[x] == ans)
              ans1++;
          } else {
            if (siz[i] > ans)
              ans = siz[i], ans1 = 1;
            else if (siz[i] == ans)
              ans1++;
          }
        } else {
          if (dep[x] + dis[x] == dis[rt]) {
            if (siz[i] + siz[rt] - siz[x] > ans)
              ans = siz[i] + siz[rt] - siz[x], ans1 = 1;
            else if (siz[i] + siz[rt] - siz[x] == ans)
              ans1++;
          } else if (dep[x] + dis[x] == fro[rt]) {
            if (siz[i] + num > ans)
              ans = siz[i] + num, ans1 = 1;
            else if (siz[i] + num == ans)
              ans1++;
          } else {
            if (siz[i] > ans)
              ans = siz[i], ans1 = 1;
            else if (siz[i] == ans)
              ans1++;
          }
        }
      } else {
        if (siz[i] > ans)
          ans = siz[i], ans1 = 1;
        else if (siz[i] == ans)
          ans1++;
      }
    }
  }
  printf("%d %d", ans, ans1);
}
