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;
long long n, m;
bool block[((long long)101 * 1000)];
vector<pair<long long, long long> > e[((long long)101 * 1000)];
pair<long long, long long> dp_down[((long long)101 * 1000)],
    dp_up[((long long)101 * 1000)], ex[((long long)101 * 1000)];
long long par[((long long)20)][((long long)101 * 1000)],
    dis[((long long)101 * 1000)];
long long prt[((long long)101 * 1000)], ans, cnt;
void pre_dfs(long long x) {
  for (int i = 1; i < ((long long)20); i++)
    par[i][x] = par[i - 1][par[i - 1][x]];
  for (auto u : e[x])
    if (u.first != par[0][x])
      dis[u.first] = dis[x] + 1, par[0][u.first] = x, pre_dfs(u.first);
}
long long iPar(long long x, long long num) {
  for (int i = 0; i < ((long long)20); i++)
    if ((num & (1 << i))) x = par[i][x];
  return x;
}
long long lca(long long x, long long y) {
  if (dis[x] < dis[y]) swap(x, y);
  x = iPar(x, dis[x] - dis[y]);
  if (x == y) return x;
  for (int i = ((long long)20) - 1; i >= 0; i--)
    if (par[i][x] != par[i][y]) x = par[i][x], y = par[i][y];
  return par[0][x];
}
pair<long long, long long> merge(pair<long long, long long> x,
                                 pair<long long, long long> y, long long v) {
  if (x.first > y.first) return x;
  if (y.first > x.first) return y;
  return {x.first, v};
}
void dfs_down(long long x, long long par = 0) {
  dp_down[x] = {-((long long)2e9), -1};
  if (block[x]) dp_down[x] = {0, x};
  for (auto u : e[x])
    if (u.first != par) {
      dfs_down(u.first, x);
      dp_down[x] = merge(
          dp_down[x],
          {dp_down[u.first].first + u.second, dp_down[u.first].second}, x);
    }
}
void dfs_up(long long x, long long par = 0) {
  if (block[x] && dp_up[x].first < 0) dp_up[x] = {0, x};
  long long num = 0;
  ex[num++] = {dp_up[x].first, -1};
  for (auto u : e[x])
    if (u.first != par)
      ex[num++] = {dp_down[u.first].first + u.second, u.first};
  sort(ex, ex + num);
  for (auto u : e[x])
    if (u.first != par) {
      pair<long long, long long> p = ex[num - 1], q = ex[num - 2];
      if (p.second == u.first)
        p = q, q = ex[num - 3];
      else if (q.second == u.first)
        q = ex[num - 3];
      dp_up[u.first].first = p.first + u.second;
      if (p.second == -1)
        dp_up[u.first].second = dp_up[x].second;
      else
        dp_up[u.first].second = dp_down[p.second].second;
      if (num > 2 && p.first == q.first) dp_up[u.first].second = x;
      dfs_up(u.first, x);
    }
}
void dfs(long long x) {
  for (auto u : e[x])
    if (u.first != par[0][x]) dfs(u.first), prt[x] += prt[u.first];
  if (!block[x]) {
    if (prt[x] > ans)
      ans = prt[x], cnt = 1;
    else if (prt[x] == ans)
      cnt++;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long x;
    cin >> x;
    block[x] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    long long v, u, w;
    cin >> v >> u >> w;
    e[v].push_back({u, w});
    e[u].push_back({v, w});
  }
  pre_dfs(1);
  dfs_down(1);
  dp_up[1] = {-((long long)2e9), -1};
  dfs_up(1);
  for (int i = 1; i <= n; i++) {
    if (!block[i]) continue;
    pair<long long, long long> x = merge(dp_up[i], dp_down[i], i);
    if (n == 100000 && x.second < 1) {
      cout << dp_down[i].first << " " << dp_down[i].second << "\n";
      cout << dp_up[i].first << " " << dp_up[i].second << "\n\n";
    }
    long long p = lca(x.second, i);
    prt[x.second]++;
    prt[i]++;
    prt[par[0][p]]--;
    prt[p]--;
  }
  dfs(1);
  cout << ans << " " << cnt << "\n";
  return 0;
}
