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 + 9, INF = 1e18 + 7;
long long num[N], mon[N], parent[N];
vector<pair<long long, long long> > adj[N];
pair<long long, long long> down[N], ans;
pair<long long, pair<long long, long long> > up[N];
void DFS1(long long u, long long par) {
  parent[u] = par;
  if (mon[u]) down[u] = {0, u};
  for (pair<long long, long long> p : adj[u]) {
    long long v = p.first, w = p.second;
    if (v != par) {
      DFS1(v, u);
      if (down[v].first + w == down[u].first) {
        down[u].second = u;
      }
      if (down[v].first + w > down[u].first) {
        down[u].first = down[v].first + w;
        down[u].second = down[v].second;
      }
    }
  }
}
void DFS2(long long u, long long par, long long len) {
  if (up[u].first < 0 && mon[u]) up[u] = {0, {u, u}};
  if (up[par].first + len == up[u].first) up[u].second = {par, par};
  if (up[par].first + len > up[u].first)
    up[u].first = up[par].first + len, up[u].second = up[par].second;
  set<pair<long long, long long> > s;
  for (pair<long long, long long> v : adj[u])
    if (v.first != par)
      s.insert({-down[v.first].first - v.second, down[v.first].second});
  for (pair<long long, long long> v : adj[u])
    if (s.size() > 1 && v.first != par) {
      s.erase({-down[v.first].first - v.second, down[v.first].second});
      pair<long long, long long> x = *s.begin();
      x.first *= -1;
      if (x.first + v.second == up[v.first].first) {
        up[v.first].second = {u, u};
      }
      if (x.first + v.second > up[v.first].first) {
        up[v.first].first = x.first + v.second;
        up[v.first].second = {u, x.second};
        s.erase({-x.first, x.second});
        if (s.size() && (*s.begin()).first == -x.first)
          up[v.first].second.second = u;
        s.insert({-x.first, x.second});
      }
      s.insert({-down[v.first].first - v.second, down[v.first].second});
    }
  s.clear();
  for (pair<long long, long long> v : adj[u])
    if (v.first != par) DFS2(v.first, u, v.second);
}
void DFS3(long long u, long long par) {
  for (pair<long long, long long> v : adj[u])
    if (v.first != par) DFS3(v.first, u), num[u] += num[v.first];
}
int32_t main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long u;
    cin >> u;
    mon[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 = 0; i <= n; i++) up[i].first = down[i].first = -INF;
  DFS1(1, 0);
  DFS2(1, 0, -INF);
  for (long long u = 1; u <= n; u++) {
    if (!mon[u]) continue;
    if (up[u].first > down[u].first) {
      num[up[u].second.first]--;
      num[parent[up[u].second.first]]--;
      num[u]++;
      num[up[u].second.second]++;
    } else {
      num[u]--;
      num[down[u].second]++;
    }
  }
  DFS3(1, 0);
  pair<long long, long long> ans = {0, 0};
  for (long long i = 1; i <= n; i++) {
    if (mon[i]) continue;
    if (num[i] == ans.first) ans.second++;
    if (num[i] > ans.first) ans = {num[i], 1};
  }
  cout << ans.first << " " << ans.second;
  return 0;
}
