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 = 1000 * 1000 + 10;
const int maxn5 = 1 * 1000 * 100 + 10;
const int maxn3 = 1000 + 10;
const long long mod = 1000 * 1000 * 1000 + 7;
const long long inf = 1LL * 2 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 10;
vector<pair<int, int>> adj[maxn5];
long long h[maxn5], mx1[maxn5], mx2[maxn5];
int cnt[maxn5], ans[maxn5], ver[maxn5], ver2[maxn5];
int add_mx1[maxn5], add_mx2[maxn5], sum[maxn5];
bool mark[maxn5];
bool wrong = false;
int sp = 49959;
void dfs(int v, int par) {
  mx1[v] = h[v];
  if (!mark[v]) mx1[v] = 0;
  for (auto [u, len] : adj[v])
    if (u != par) {
      h[u] = h[v] + len;
      dfs(u, v);
      if (mx1[u] >= mx1[v])
        mx2[v] = mx1[v], mx1[v] = mx1[u], ver2[v] = ver[v], ver[v] = u;
      else if (mx2[v] < mx1[u])
        mx2[v] = mx1[u], ver2[v] = u;
    }
  return;
}
void dfs_up(int v, int par, long long mxdist, int hca) {
  bool add = false;
  if (mxdist < mx1[v] - h[v] and mark[v] and mx1[v] > mx2[v])
    add_mx1[v]++;
  else if (mxdist > mx1[v] - h[v] and mark[v])
    cnt[hca]++, add = true;
  long long mx = 0;
  sum[v] = 0;
  int count = 0;
  int lenver, lenver2;
  for (auto [u, len] : adj[v]) {
    if (u != par and u != ver[v] and u != ver2[v]) {
      int hcaout, mxdistout;
      if (mx1[v] - h[v] >= mxdist)
        hcaout = v, mxdistout = mx1[v] - h[v] + len;
      else
        hcaout = hca, mxdistout = mxdist + len;
      dfs_up(u, v, mxdistout, hcaout);
      mx = max(mx, mx1[u]);
      sum[v] += sum[u];
      count++;
    } else if (u == ver[v])
      lenver = len;
    else if (u == ver2[v])
      lenver2 = len;
  }
  if (mx1[v] - h[v] > mxdist and mx1[v] > mx2[v]) add_mx1[v] += cnt[v];
  int a = cnt[v];
  cnt[v] = 0;
  if (ver2[v] != 0) {
    int hcaout, mxdistout;
    int len = lenver2;
    if (mx1[v] - h[v] >= mxdist)
      hcaout = v, mxdistout = mx1[v] - h[v] + len;
    else
      hcaout = hca, mxdistout = mxdist + len;
    dfs_up(ver2[v], v, mxdistout, hcaout);
    sum[v] += sum[ver2[v]];
    if (mx < mx1[v] and mx1[v] - h[v] > mxdist) add_mx1[v] += cnt[v];
    a += cnt[v];
    cnt[v] = 0;
    count++;
  }
  if (ver[v] != 0) {
    int hcaout, mxdistout;
    int len = lenver;
    if (mx2[v] - h[v] >= mxdist)
      hcaout = v, mxdistout = mx2[v] - h[v] + len;
    else
      hcaout = hca, mxdistout = mxdist + len;
    dfs_up(ver[v], v, mxdistout, hcaout);
    sum[v] += sum[ver[v]];
    if (mx2[v] - h[v] > mxdist and mx2[v] > mx) add_mx2[v] += cnt[v];
    a += cnt[v];
    cnt[v] = 0;
    count++;
  }
  if (v == sp and wrong)
    cout << ans[v] << ' ' << sum[v] << ' ' << a << ' ' << mx1[v] << ' '
         << mx2[v] << ' ' << count << endl;
  ans[v] += sum[v];
  sum[v] -= a;
  if (add) sum[v]++;
  return;
}
void dfs_add(int v, int par, int add) {
  ans[v] += add;
  if (v == sp and wrong)
    cout << "add f " << add << ' ' << ans[v] << ' ' << h[v] << endl;
  if (v == sp and wrong)
    cout << ' ' << ver[par] << ' ' << ver2[par] << ' ' << add_mx1[par] << ' '
         << add_mx2[par] << ' ' << par << endl;
  if (v == sp and wrong) cout << mx1[par] << ' ' << mx2[par] << endl;
  if (mx1[v] == mx2[v]) add = 0;
  for (auto [u, len] : adj[v])
    if (u != par)
      dfs_add(
          u, v,
          add + (u == ver[v] ? (add_mx1[v]) : (u == ver2[v] ? add_mx2[v] : 0)));
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  if (m == 99999) wrong = true;
  int root = 1;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    mark[a] = true;
    root = a;
  }
  int v = 0;
  for (int i = 1; i <= n; i++)
    if (!mark[i] and wrong) v = i;
  for (int i = 0; i < n - 1; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    adj[a].push_back({b, c});
    adj[b].push_back({a, c});
  }
  dfs(root, -1);
  dfs_up(root, -1, 0, 0);
  dfs_add(root, -1, 0);
  int mx = 0, num = 0;
  for (int i = 1; i <= n; i++)
    if (!mark[i]) mx = max(mx, ans[i]);
  cout << mx << ' ';
  for (int i = 1; i <= n; i++)
    if (!mark[i] and mx == ans[i]) num++;
  cout << num << endl;
  int i = v;
  if (wrong) cout << i << ' ' << mark[i] << ' ' << ans[i] << ' ' << endl;
  return 0;
}
