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 long long MAXN = 1e5 + 10, INF = 1e9 * 1LL * 1e9;
vector<pair<long long, long long>> adj[MAXN];
bitset<MAXN> pilgrim;
pair<long long, long long> down[MAXN], up[MAXN];
long long cnt[2][MAXN];
long long h[MAXN], p[MAXN][20];
long long lca(long long a, long long b) {
  if (h[a] < h[b]) swap(a, b);
  long long delta = h[a] - h[b];
  long long t = 0;
  for (; delta; delta >>= 1, ++t)
    if (delta & 1) a = p[a][t];
  t = 20 - 1;
  while (a != b) {
    while (t && p[a][t] == p[b][t]) --t;
    a = p[a][t];
    b = p[b][t];
  }
  return a;
}
void dfs_down(long long v, long long par) {
  down[v] = {-INF, 0};
  for (long long i = 1; i < 20; ++i) p[v][i] = p[p[v][i - 1]][i - 1];
  for (auto i : adj[v])
    if (i.first != par) {
      h[i.first] = h[v] + 1;
      p[i.first][0] = v;
      dfs_down(i.first, v);
      if (down[i.first].first + i.second == down[v].first) down[v].second = v;
      if (down[i.first].first + i.second > down[v].first)
        down[v] = {down[i.first].first + i.second, down[i.first].second};
      if (pilgrim[i.first] && down[v].first == i.second) down[v].second = v;
      if (pilgrim[i.first] && down[v].first < i.second)
        down[v] = {i.second, i.first};
    }
}
void dfs_up(long long v, long long par) {
  pair<long long, long long> mn[3] = {up[v], {-INF, INF}, {-INF, INF}};
  for (auto i : adj[v])
    if (i.first != par) {
      down[i.first].first += i.second;
      pair<long long, long long> now = down[i.first];
      if (pilgrim[i.first] && now.first < i.second) now = {i.second, i.first};
      down[i.first].first -= i.second;
      if (mn[2] < now) mn[2] = now;
      for (long long i = 1; i >= 0; --i)
        if (mn[i] < mn[i + 1]) swap(mn[i], mn[i + 1]);
    }
  if (pilgrim[v]) {
    ++cnt[0][v];
    long long u = (mn[0].first == mn[1].first ? v : mn[0].second);
    ++cnt[0][u];
    ++cnt[1][lca(v, u)];
    pair<long long, long long> now = {0, v};
    if (mn[2] < now) mn[2] = now;
    if (mn[1] < mn[2]) swap(mn[1], mn[2]);
    if (mn[0] < mn[1]) swap(mn[0], mn[1]);
  }
  for (auto i : adj[v])
    if (i.first != par) {
      down[i.first].first += i.second;
      pair<long long, long long> now = down[i.first];
      down[i.first].first -= i.second;
      if (pilgrim[i.first] && now.first < i.second) now = {i.second, i.first};
      if (now == mn[0]) {
        up[i.first] = {mn[1].first,
                       (mn[1].first == mn[2].first ? v : mn[1].second)};
      } else if (now == mn[1])
        up[i.first] = {mn[0].first,
                       (mn[0].first == mn[2].first ? v : mn[0].second)};
      else
        up[i.first] = {mn[0].first,
                       (mn[0].first == mn[1].first ? v : mn[0].second)};
      up[i.first].first += i.second;
    }
  for (auto i : adj[v])
    if (i.first != par) dfs_up(i.first, v);
}
long long ans1, ans2;
long long dfs(long long v, long long par) {
  long long now = cnt[0][v];
  for (auto i : adj[v])
    if (i.first != par) now += dfs(i.first, v);
  now -= cnt[1][v];
  if (!pilgrim[v]) {
    if (ans1 < now) {
      ans1 = now;
      ans2 = 0;
    }
    if (ans1 == now) ++ans2;
  }
  now -= cnt[1][v];
  return now;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, m, a1, a2, a3;
  cin >> n >> m;
  while (m--) {
    cin >> a1;
    pilgrim[a1] = true;
  }
  for (long long i = 1; i < n; ++i) {
    cin >> a1 >> a2 >> a3;
    adj[a1].push_back({a2, a3});
    adj[a2].push_back({a1, a3});
  }
  dfs_down(1, -1);
  up[1].first = -INF;
  dfs_up(1, -1);
  dfs(1, -1);
  cout << ans1 << ' ' << ans2;
  return 0;
}
