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 maxn = 1e5 + 5, mod = 1e9 + 7, inf = 1e18;
long long n, m, dep[maxn], h[maxn], ps[maxn], par[maxn];
bool mrk[maxn];
vector<pair<long long, long long> > adj[maxn];
pair<long long, long long> d0[maxn], d1[maxn];
void dfs(long long u) {
  for (pair<long long, long long> j : adj[u]) {
    long long v = j.first, w = j.second;
    if (v == par[u]) continue;
    h[v] = h[u] + 1ll;
    par[v] = u;
    dfs(v);
    pair<long long, long long> pl = {-inf, 0};
    if (mrk[v]) pl = {w, v};
    if (pl.first < d0[v].first + w) pl = {d0[v].first + w, d0[v].second};
    if (pl.first == d0[u].first)
      d0[u].second = u;
    else if (pl.first > d0[u].first)
      d0[u] = pl;
    if (d0[u].first < -mod) d0[u] = {-inf, 0};
  }
}
void dfs2(long long u) {
  set<pair<long long, long long> > s;
  for (pair<long long, long long> j : adj[u]) {
    long long v = j.first, w = j.second;
    if (v == par[u]) continue;
    if (d0[v].first > 0) s.insert({d0[v].first + w, d0[v].second});
    if (mrk[v]) s.insert({w, v});
  }
  for (pair<long long, long long> j : adj[u]) {
    long long v = j.first, w = j.second;
    if (v == par[u]) continue;
    if (d0[v].first > 0) s.erase({d0[v].first + w, d0[v].second});
    if (mrk[v]) s.erase({w, v});
    pair<long long, long long> P = {-inf, 0};
    if (s.size()) P = (*s.rbegin());
    if (P.first < d1[u].first) {
      d1[v] = {d1[u].first + w, d1[u].second};
      dep[v] = dep[u];
    } else if (P.first == d1[u].first) {
      dep[v] = u;
      d1[v] = {d1[u].first + w, d1[u].second};
    } else {
      dep[v] = u;
      s.erase(P);
      if (s.size()) {
        if ((*s.rbegin()).first == P.first)
          d1[v] = {P.first + w, u};
        else
          d1[v] = {P.first + w, P.second};
      } else
        d1[v] = {P.first + w, P.second};
      s.insert(P);
    }
    if (d0[v].first > 0) s.insert({d0[v].first + w, d0[v].second});
    if (mrk[v]) s.insert({w, v});
    if (mrk[u]) {
      if (w > d1[v].first) {
        dep[v] = u;
        d1[v] = {w, u};
      }
    }
    if (d1[v].first < -mod) d1[v] = {-inf, 0};
    dfs2(v);
  }
}
pair<long long, long long> ans;
void DFS(long long u) {
  for (pair<long long, long long> j : adj[u]) {
    long long v = j.first;
    if (v == par[u]) continue;
    DFS(v);
    ps[u] += ps[v];
  }
  if (mrk[u]) return;
  if (ans.first < ps[u])
    ans = {ps[u], 1};
  else if (ans.first == ps[u])
    ans.second++;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  while (m--) {
    long long u;
    cin >> u;
    mrk[u] = 1;
  }
  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});
  }
  for (long long i = 1; i <= n; i++) d0[i] = {-inf, 0};
  dfs(1);
  for (long long i = 1; i <= n; i++) d1[i] = {-inf, 0};
  dfs2(1);
  for (long long i = 1; i <= n; i++) {
    if (d0[i].first == d1[i].first) continue;
    if (!mrk[i]) continue;
    if (d0[i].first > d1[i].first) {
      ps[d0[i].second]++;
      ps[par[i]]--;
    } else {
      if (h[dep[i]] >= h[d1[i].second]) {
        ps[i]++;
        ps[par[dep[i]]]--;
      } else {
        ps[i]++;
        ps[d1[i].second]++;
        ps[dep[i]]--;
        ps[par[dep[i]]]--;
      }
    }
  }
  DFS(1);
  cout << ans.first << ' ' << ans.second;
}
