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 maxn = 1e5 + 10;
struct edge {
  int to, d;
};
vector<edge> e[maxn];
bool is[maxn];
int n, m, p1 = 0, p2 = 0, diameter = 0, root = 0;
int len[maxn][2];
void find_p1(int x, int fa, int node) {
  if (is[x] && diameter < node) p1 = x, diameter = node;
  for (int i = 0; i < e[x].size(); i++) {
    int y = e[x][i].to;
    if (y == fa) continue;
    find_p1(y, x, node + e[x][i].d);
  }
}
void find_p2(int x, int fa) {
  if (is[x] && diameter < len[x][0]) p2 = x, diameter = len[x][0];
  for (int i = 0; i < e[x].size(); ++i) {
    int y = e[x][i].to;
    if (y == fa) continue;
    len[y][0] = len[x][0] += e[x][i].d;
    find_p2(y, x);
  }
}
void makedis(int x, int fa, int node) {
  len[x][1] = node;
  for (int i = 0; i < e[i].size(); ++i) {
    int y = e[x][i].to;
    if (y == fa) continue;
    makedis(y, x, node + e[x][i].d);
  }
}
void choose_root() {
  find_p1(1, 0, 0);
  diameter = 0;
  find_p2(p1, 0);
  makedis(p2, 0, 0);
  int midata = 1e9;
  for (int i = 1; i <= n; ++i) {
    if (len[i][0] + len[i][1] != len[p1][1]) continue;
    int d1 = abs(len[i][0] - len[i][1]);
    if (d1 < midata) midata = d1, root = i;
  }
}
int cnt[maxn], link[maxn], nums[maxn];
int id[maxn];
void dfs(int x, int fa, int dis) {
  if (fa == root)
    id[x] = x;
  else
    id[x] = id[fa];
  cnt[x] = is[x] ? 1 : 0;
  for (int i = 0; i < e[x].size(); ++i) {
    int y = e[x][i].to;
    if (y == fa) continue;
    dfs(y, x, dis + e[x][1].d);
    cnt[x] += cnt[y];
  }
  if (cnt[x]) {
    link[x] = dis, nums[x] = 1;
    for (int i = 0; i < e[x].size(); ++i) {
      int y = e[x][i].to;
      if (y == fa) continue;
      if (link[y] > link[x])
        link[x] = link[y], nums[x] = nums[y];
      else if (link[y] == link[x])
        nums[x] += nums[y];
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1, a; i <= m; ++i) cin >> a, is[a] = 1;
  for (int i = 1, u, v, w; i <= n - 1; ++i) {
    cin >> u >> v >> w;
    e[u].push_back((edge){v, w});
    e[v].push_back((edge){u, w});
  }
  choose_root();
  dfs(root, 0, 0);
  int ma1 = 0, ma2 = 0, id1 = 0, id2 = 0, ma1cnt = 0;
  for (int i = 0; i < e[root].size(); ++i) {
    int y = e[root][i].to;
    if (!cnt[y]) continue;
    if (link[y] > ma1)
      ma2 = ma1, ma1 = link[y];
    else if (link[y] > ma2)
      ma2 = link[y];
  }
  for (int i = 0; i < e[root].size(); ++i) {
    int y = e[root][i].to;
    if (!cnt[y]) continue;
    if (link[y] == ma1) ma1cnt++, id1 = y;
    if (link[y] == ma2 && !id2) id2 = y;
  }
  if (ma1cnt >= 3) id1 = id2 = 0;
  int ret1 = 0, ret2 = 0;
  if (!is[root]) ret1 = m, ret2 = 1;
  for (int i = 1; i <= n; ++i) {
    if (i == root || is[i]) continue;
    int CNT = cnt[i], belong = id[i];
    if (CNT && (link[belong] == link[i]) && (nums[belong] == nums[i])) {
      if (belong == id1) {
        if (ma1 != ma2)
          CNT += m - cnt[belong];
        else
          CNT += cnt[id2];
      } else if (belong == id2)
        CNT += cnt[id1];
    }
    if (CNT > ret1)
      ret1 = CNT, ret2 = 1;
    else if (CNT == ret1)
      ret2++;
  }
  cout << ret1 << " " << ret2 << endl;
}
