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 INF = 1e9 + 10, MN = 1e5 + 10;
int dp_up[MN], dp_down[MN], D[MN], root[MN];
int dia, rt, n, mx_ans = -INF, cnt_ans = 1;
bool is[MN];
int sz[MN], A[MN], Mx[MN], P[MN], m;
vector<int> vec;
vector<pair<int, int> > adj[MN];
void dfs_up(int s, int pr) {
  P[s] = pr;
  dp_up[s] = -INF;
  if (is[s]) dp_up[s] = 0;
  for (auto v : adj[s])
    if (v.first ^ pr) {
      dfs_up(v.first, s);
      dp_up[s] = max(dp_up[s], dp_up[v.first] + v.second);
    }
}
void dfs_down(int s, int pr) {
  D[s] = max(dp_down[s], dp_up[s]);
  Mx[0] = -INF;
  for (int i = 0; i < ((int)(adj[s]).size()); ++i) {
    int v = adj[s][i].first, c = adj[s][i].second;
    if (v == pr)
      Mx[i + 1] = Mx[i];
    else
      Mx[i + 1] = max(Mx[i], dp_up[v] + c);
  }
  int cur = -INF;
  for (int i = ((int)(adj[s]).size()) - 1; ~i; --i) {
    int v = adj[s][i].first, c = adj[s][i].second;
    if (v == pr) continue;
    dp_down[v] = c + max(dp_down[s], max(cur, Mx[i]));
    if (is[v]) dp_down[v] = max(dp_down[v], 0);
    cur = max(cur, dp_up[v] + c);
  }
  for (auto x : adj[s])
    if (x.first ^ pr) dfs_down(x.first, s);
}
void dfs(int s, int pr) {
  if (~pr) root[s] = root[pr];
  sz[s] = (D[s] == dia) && is[s];
  A[s] = is[s];
  for (auto v : adj[s])
    if (v.first ^ pr) {
      dfs(v.first, s);
      sz[s] += sz[v.first];
      A[s] += A[v.first];
    }
}
void upd_ans(int val) {
  if (val > mx_ans)
    mx_ans = val, cnt_ans = 1;
  else if (val == mx_ans)
    ++cnt_ans;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  int T = m;
  while (T--) {
    int x;
    cin >> x;
    is[x - 1] = true;
  }
  for (int i = 1; i < n; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    --a, --b;
    adj[a].push_back({b, c}), adj[b].push_back({a, c});
  }
  dfs_up(0, -1);
  fill(dp_down, dp_down + n, -INF);
  if (is[0]) dp_down[0] = 0;
  dfs_down(0, -1);
  int rad = *min_element(D, D + n);
  int rt = -1;
  for (int i = 0; i < n; ++i)
    if (is[i]) {
      dia = max(D[i], dia);
    }
  for (int i = 0; i < n; ++i)
    if (D[i] == rad) vec.push_back(i);
  if (((int)(vec).size()) == 1 && D[vec[0]] == dia / 2) {
    if (!is[vec[0]]) upd_ans(m);
    rt = vec[0];
    vec.clear();
    for (auto x : adj[rt]) vec.push_back(x.first);
  } else if (((int)(vec).size()) == 1) {
    for (auto x : adj[vec[0]]) {
      int v = x.first;
      if (v == P[x.first]) {
        if (dp_down[v] + x.second == D[vec[0]]) vec.push_back(v);
      } else {
        if (dp_up[v] + x.second == D[vec[0]]) vec.push_back(v);
      }
    }
  }
  int sm = 0, num = 0;
  for (auto x : vec) {
    if (rt == -1) {
      if (x == vec[0])
        dfs(x, vec[1]);
      else
        dfs(x, vec[0]);
    } else
      dfs(x, rt);
    if (sz[x]) ++num, sm += A[x];
  }
  for (int i = 0; i < n; ++i)
    if (i != rt && !is[i]) {
      int x = root[i];
      if (sz[x] ^ sz[i])
        upd_ans(A[i]);
      else {
        if (num == 2)
          upd_ans(sm - A[x] + A[i]);
        else
          upd_ans(A[i]);
      }
    }
  cout << mx_ans << ' ' << cnt_ans << '\n';
  return 0;
}
