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 long long N = 1e5 + 5, INF = -1e9;
long long down[N], mx[N], up[N], dp[N], sum[N];
unordered_map<long long, vector<long long>> mp[N];
long long n, m, pre[N], suf[N], ans[N];
vector<pair<long long, long long>> adj[N];
bool mark[N];
void dfs_down(long long u, long long par) {
  down[u] = up[u] = mark[u] ? 0 : INF;
  for (auto x : adj[u]) {
    long long v = x.first, w = x.second;
    if (v == par) continue;
    dfs_down(v, u);
    mp[u][down[v] + w].push_back(v);
    down[u] = max(down[u], down[v] + w);
  }
  pre[0] = suf[adj[u].size() - 1] = INF;
  for (long long i = 0; i < adj[u].size(); i++) {
    long long v = adj[u][i].first, w = adj[u][i].second;
    pre[i + 1] = v ^ par ? max(pre[i], down[v] + w) : pre[i];
  }
  for (long long i = adj[u].size() - 1; i; i--) {
    long long v = adj[u][i].first, w = adj[u][i].second;
    suf[i - 1] = v ^ par ? max(suf[i], down[v] + w) : suf[i];
  }
  for (long long i = 0; i < adj[u].size(); i++)
    if (adj[u][i].first ^ par) mx[adj[u][i].first] = max(suf[i], pre[i]);
}
void dfs_up(long long u, long long par) {
  for (auto x : adj[u]) {
    long long v = x.first, w = x.second;
    if (v == par) continue;
    up[v] = max(up[v], max(up[u], mx[v]) + w);
    dfs_up(v, u);
  }
}
void dfs1(long long u, long long par) {
  if (mark[u] && up[u] > down[u]) dp[u]++;
  for (auto x : adj[u]) {
    long long v = x.first, w = x.second;
    if (v == par) continue;
    dfs1(v, u);
    ans[u] += dp[v];
    if (up[u] > mx[v]) dp[u] += dp[v];
    if (up[u] < mx[v]) {
      long long sz = mp[u][mx[v]].size();
      if (down[v] + w == mx[v]) sz--;
      if (sz ^ 1) continue;
      for (long long s : mp[u][mx[v]])
        if (s ^ v) sum[s] += dp[v];
    }
  }
}
void dfs2(long long u, long long par) {
  if (mark[u] && down[u] > up[u]) sum[u]++;
  if (mp[u][down[u]].size() == 1) sum[mp[u][down[u]][0]] += sum[u];
  for (auto x : adj[u])
    if (x.first ^ par) dfs2(x.first, u);
  ans[u] += sum[u];
}
inline void read_input() {
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long v;
    cin >> v;
    mark[--v] = true;
  }
  for (long long i = 1; i < n; i++) {
    long long u, v, w;
    cin >> u >> v >> w;
    adj[--u].push_back({--v, w});
    adj[v].push_back({u, w});
  }
}
inline void solve() {
  dfs_down(0, 0);
  dfs_up(0, 0);
  dfs1(0, 0);
  dfs2(0, 0);
}
inline void write_output() {
  long long mx = 0, cnt = 0;
  for (long long u = 0; u < n; u++) {
    if (mark[u]) continue;
    if (mx < ans[u]) {
      mx = ans[u];
      cnt = 0;
    }
    if (mx == ans[u]) cnt++;
  }
  cout << mx << ' ' << cnt << endl;
}
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read_input(), solve(), write_output();
  return 0;
}
