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 N = 1e5 + 7;
const int INF = 1e9 + 7;
vector<pair<int, int> > adj[N];
pair<int, int> dp[N], up[N];
pair<int, int> L[N], R[N];
pair<int, int> par[N];
int ds[N], us[N];
bool bad[N];
inline pair<int, int> merge(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first) return {a.first, a.second + b.second};
  return max(a, b);
}
void dfs_down(int v, int p) {
  for (auto u : adj[v]) {
    if (u.first == p) continue;
    dfs_down(u.first, v);
    dp[v] = merge(dp[v], {dp[u.first].first + u.second, dp[u.first].second});
  }
  for (int i = 0; i < (int)adj[v].size(); i++)
    if (adj[v][i].first == p) {
      adj[v].erase(adj[v].begin() + i);
      break;
    }
}
void dfs_up(int v) {
  L[0] = R[adj[v].size()] = {-INF, 0};
  for (int i = 0; i < (int)adj[v].size(); i++)
    L[i + 1] = merge(L[i], {dp[adj[v][i].first].first + adj[v][i].second,
                            dp[adj[v][i].first].second});
  for (int i = (int)adj[v].size() - 1; i >= 0; i--)
    R[i] = merge(R[i + 1], {dp[adj[v][i].first].first + adj[v][i].second,
                            dp[adj[v][i].first].second});
  for (int i = 0; i < (int)adj[v].size(); i++) {
    auto tmp = merge(merge(L[i], R[i + 1]), up[v]);
    up[adj[v][i].first] = {tmp.first + adj[v][i].second, tmp.second};
  }
  for (auto u : adj[v]) dfs_up(u.first);
}
void dfs1(int v) {
  for (auto u : adj[v]) dfs1(u.first);
  for (auto u : adj[v])
    if (merge(dp[u.first], up[u.first]) == up[u.first]) ds[v] += ds[u.first];
}
void dfs2(int v) {
  for (auto u : adj[v])
    if (merge(dp[v], up[v]) ==
        make_pair(dp[u.first].first + u.second, dp[u.first].second))
      us[u.first] += ds[v] + us[v];
  for (auto u : adj[v]) dfs2(u.first);
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) dp[i].first = up[i].first = -INF;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    dp[--x] = {0, 1};
    bad[x] = 1;
    ds[x] = 1;
  }
  for (int i = 1; i < n; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    u--, v--;
    adj[v].push_back({u, w});
    adj[u].push_back({v, w});
  }
  dfs_down(0, -1);
  dfs_up(0);
  dfs1(0);
  dfs2(0);
  int mx = 0, cnt = 0;
  for (int i = 0; i < n; i++)
    if (!bad[i]) mx = max(mx, ds[i] + us[i]);
  for (int i = 0; i < n; i++)
    if (!bad[i]) cnt += (ds[i] + us[i] == mx);
  cout << mx << " " << cnt << "\n";
  return 0;
}
