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 in() {
  int ret;
  cin >> ret;
  return ret;
}
const int N = 1e5 + 10, INF = 1e9 + 7;
int n, m, h1[N], h2[N], c[N], rad = INF, sz[N], ans, cnt;
vector<pair<int, int> > adj[N];
bool mon[N];
void dfs(int v, int par) {
  h1[v] = h2[v] = 0;
  sz[v] = (mon[v] ? 1 : 0);
  for (auto u : adj[v])
    if (par != u.first) {
      dfs(u.first, v);
      if (sz[u.first]) {
        sz[v] += sz[u.first];
        if ((h1[u.first] + u.second) > h1[v])
          h2[v] = h1[v], h1[v] = (h1[u.first] + u.second), c[v] = u.first;
        else if ((h1[u.first] + u.second) > h2[v])
          h2[v] = (h1[u.first] + u.second);
      }
    }
}
int findCenter(int v, int par, int dis) {
  int r = max(dis, h1[v]), cen = 0;
  if (r < rad) rad = r, cen = v;
  for (auto u : adj[v])
    if (par != u.first) {
      int tmp = findCenter(
          u.first, v,
          sz[u.first] == m
              ? 0
              : max(dis, c[v] == u.first ? h2[v] : h1[v]) + u.second);
      if (tmp) cen = tmp;
    }
  return cen;
}
void dfs2(int par, int v, int k) {
  if (!mon[v]) {
    if ((sz[v] + k) > ans)
      ans = (sz[v] + k), cnt = 1;
    else if ((sz[v] + k) == ans)
      cnt++;
  }
  for (auto u : adj[v])
    if (par != u.first)
      dfs2(v, u.first, (c[v] == u.first && h1[v] != h2[v]) ? k : 0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) mon[in()] = true;
  for (int i = 1; i < n; i++) {
    int u = in(), v = in(), w = in();
    adj[u].push_back({v, w}), adj[v].push_back({u, w});
  }
  dfs(1, 1);
  int cen = findCenter(1, 1, 0);
  dfs(cen, cen);
  int a1 = 0, a2 = 0, a3 = 0, b1 = -1, b2 = -1;
  for (auto u : adj[cen]) {
    if ((h1[u.first] + u.second) > a1)
      a3 = a2, a2 = a1, a1 = (h1[u.first] + u.second), b2 = b1, b1 = u.first;
    else if ((h1[u.first] + u.second) > a2)
      a3 = a2, a2 = (h1[u.first] + u.second), b2 = u.first;
    else if ((h1[u.first] + u.second) > a3)
      a3 = (h1[u.first] + u.second);
  }
  if (!mon[cen]) ans = sz[cen], cnt = 1;
  for (auto u : adj[cen]) {
    if (u.first == b1)
      dfs2(cen, u.first,
           a1 != a2   ? sz[cen] - sz[u.first]
           : a1 != a3 ? sz[b2]
                      : 0);
    else if (u.first == b2)
      dfs2(cen, u.first, a2 != a3 ? sz[b1] : 0);
    else
      dfs2(cen, u.first, 0);
  }
  cout << ans << " " << cnt << '\n';
  return 0;
}
