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], ver[maxn5];
int cnt[maxn5], ans[maxn5], sum = 0;
bool mark[maxn5];
void dfs(int v, int par) {
  mx1[v] = h[v];
  ver[v] = 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], ver[v] = u;
      else if (mx2[v] < mx1[u])
        mx2[v] = mx1[u];
    }
  return;
}
void dfs_up(int v, int par, long long mxdist, int hca, int top_add) {
  bool add = false;
  ans[v] += top_add;
  if (mxdist < mx1[v] - h[v] and mark[v])
    top_add++;
  else if (mxdist > mx1[v] - h[v] and mark[v])
    cnt[hca]++, add = true;
  if (mx1[v] == mx2[v]) top_add = 0;
  for (auto [u, len] : adj[v])
    if (u != par) {
      int hcaout, mxdistout;
      if (u == ver[v]) {
        if (mx2[v] - h[v] >= mxdist)
          hcaout = v, mxdistout = mx2[v] - h[v] + len;
        else
          hcaout = hca, mxdistout = mxdist + len;
      } else {
        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, top_add);
    }
  ans[v] += sum;
  sum -= cnt[v];
  if (add) sum++;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    mark[a] = true;
  }
  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(1, -1);
  dfs_up(1, -1, 0, 0, 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;
  return 0;
}
