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;
void run();
int main() {
  ios::sync_with_stdio(0);
  run();
}
set<pair<int, long long>> edge[100000];
int depth[100000];
int anc[100000][22];
long long ans[100000];
long long aft[100000];
pair<long long, int> dn[100000];
pair<long long, int> up[100000];
bool used[100000];
void prep(int x) {
  if (used[x])
    dn[x] = {0, x};
  else
    dn[x] = {-(1ll << 55ll), -1};
  for (int i = 0; i < 21; i++) {
    anc[x][i + 1] = anc[anc[x][i]][i];
  }
  for (auto y : edge[x]) {
    edge[y.first].erase({x, y.second});
    depth[y.first] = depth[x] + 1;
    anc[y.first][0] = x;
    prep(y.first);
    if (dn[y.first].first >= 0 and
        dn[y.first].first + y.second >= dn[x].first) {
      if (dn[y.first].first + y.second > dn[x].first) {
        dn[x] = {dn[y.first].first + y.second, dn[y.first].second};
      } else {
        dn[x].second = x;
      }
    }
  }
}
void calc(int x) {
  vector<pair<long long, int>> all;
  for (auto y : edge[x]) {
    if (dn[y.first].first >= 0)
      all.push_back({dn[y.first].first + y.second, dn[y.first].second});
    else
      all.push_back({-(1ll << 55ll), x});
  }
  if (up[x].first >= 0)
    all.push_back(up[x]);
  else
    all.push_back({-(1ll << 55ll), x});
  sort(all.begin(), all.end());
  for (auto y : edge[x]) {
    int a = all.size() - 1 - (dn[y.first].second == all.back().second);
    pair<int, int> r = all[a];
    for (int q = 3, b = a; b-- and q-- and all[a].first == all[b].first;) {
      if (dn[y.first].second != r.first) {
        r.second = x;
      }
    }
    if (r.first >= 0)
      up[y.first] = {r.first + y.second, r.second};
    else if (used[y.first])
      up[y.first] = {0, y.first};
    else
      up[y.first] = {-(1ll << 55ll), y.first};
    calc(y.first);
  }
}
int lca(int a, int b) {
  if (depth[a] < depth[b]) swap(a, b);
  for (int i = 22; i--;)
    if ((depth[a] - depth[b]) & (1 << i)) a = anc[a][i];
  if (a == b) return a;
  for (int i = 22; i--;)
    if (anc[a][i] != anc[b][i]) a = anc[a][i], b = anc[b][i];
  return anc[a][0];
}
void solve(int x) {
  for (auto y : edge[x]) {
    solve(y.first);
    aft[x] += aft[y.first];
  }
  ans[x] += aft[x];
}
void run() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    --x;
    used[x] = true;
  }
  for (int i = 1; i < n; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    --a, --b;
    edge[a].insert({b, c});
    edge[b].insert({a, c});
  }
  if (not used[0]) up[0] = {-(1ll << 55ll), 0};
  prep(0);
  calc(0);
  for (int i = 0; i < n; i++) {
    if (not used[i]) continue;
    int a = i;
    int b = a;
    if (up[a].first > dn[a].first and up[a].first > 0)
      b = up[a].second;
    else if (dn[a].first > up[a].first and dn[a].first > 0)
      b = dn[a].second;
    else
      continue;
    int l = lca(a, b);
    if (a != b) {
      aft[a] += 1;
      aft[b] += 1;
      aft[l] -= 2;
      ans[l] += 1;
    }
  }
  solve(0);
  pair<int, int> res = {0, 0};
  for (int i = n; i--;) {
    if (used[i]) continue;
    if (ans[i] == res.first) {
      ++res.second;
    } else if (ans[i] > res.first) {
      res = {ans[i], 1};
    }
  }
  cout << res.first << " " << res.second << endl;
}
