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;
vector<int> l[100010], r[100010], chosenl[100010], chosenr[100010];
vector<bool> badl[100010], badr[100010];
bool monst[100010];
int ans[100010];
vector<pair<int, int> > edges[100010];
int cnt[100010], toFather[100010], fromFather[100010];
void longPathChild(int v, int f) {
  if (monst[v])
    ans[v] = 0;
  else
    ans[v] = -1000000000;
  for (int i = 0; i < edges[v].size(); i++) {
    if (edges[v][i].first != f) {
      longPathChild(edges[v][i].first, v);
      ans[v] = max(ans[v], ans[edges[v][i].first] + edges[v][i].second);
    }
  }
}
int longPathFather(int v, int f, int u) {
  for (int i = 0; i <= edges[v].size(); i++) {
    l[v].push_back(0);
    badl[v].push_back(true);
    chosenl[v].push_back(-1);
    r[v].push_back(0);
    badr[v].push_back(true);
    chosenr[v].push_back(-1);
  }
  l[v][0] = r[v][edges[v].size()] = -1000000000;
  if (monst[v]) l[v][0] = 0;
  for (int i = 0; i < edges[v].size(); i++) {
    int t;
    if (edges[v][i].first != f)
      t = ans[edges[v][i].first] + edges[v][i].second;
    else
      t = u;
    if (t > l[v][i]) {
      l[v][i + 1] = t;
      badl[v][i + 1] = false;
      chosenl[v][i + 1] = edges[v][i].first;
    } else if (t == l[v][i]) {
      l[v][i + 1] = l[v][i];
      badl[v][i + 1] = true;
      chosenl[v][i + 1] = edges[v][i].first;
    } else {
      l[v][i + 1] = l[v][i];
      badl[v][i + 1] = badl[v][i];
      chosenl[v][i + 1] = chosenl[v][i];
    }
  }
  for (int i = edges[v].size() - 1; i >= 0; i--) {
    int t;
    if (edges[v][i].first != f)
      t = ans[edges[v][i].first] + edges[v][i].second;
    else
      t = u;
    if (t > r[v][i + 1]) {
      r[v][i] = t;
      badr[v][i] = false;
      chosenr[v][i] = edges[v][i].first;
    } else if (t == r[v][i + 1]) {
      r[v][i] = r[v][i + 1];
      badr[v][i] = true;
      chosenr[v][i] = edges[v][i].first;
    } else {
      r[v][i] = r[v][i + 1];
      badr[v][i] = badr[v][i + 1];
      chosenr[v][i] = chosenr[v][i + 1];
    }
  }
  int ret = 0;
  for (int i = 0; i < edges[v].size(); i++)
    if (edges[v][i].first != f) {
      int t = longPathFather(edges[v][i].first, v,
                             max(l[v][i], r[v][i + 1]) + edges[v][i].second);
      if (l[v][i] > r[v][i + 1] && l[v][i] == u && !badl[v][i]) ret += t;
      if (r[v][i + 1] > l[v][i] && r[v][i + 1] == u && !badr[v][i + 1])
        ret += t;
      cnt[v] += t;
    }
  if (monst[v] && l[v][edges[v].size()] == u && !badl[v][edges[v].size()])
    ret++;
  return (toFather[v] = ret);
}
void fillFromFather(int v, int f) {
  cnt[v] += fromFather[v];
  for (int i = 0; i < edges[v].size(); i++) {
    if (max(l[v][i], r[v][i + 1]) < 0) continue;
    if (edges[v][i].first != f) {
      if (l[v][i] > r[v][i + 1] && !badl[v][i] && chosenl[v][i] != f)
        fromFather[chosenl[v][i]] += toFather[edges[v][i].first];
      if (r[v][i + 1] > l[v][i] && !badr[v][i + 1] && chosenr[v][i + 1] != f)
        fromFather[chosenr[v][i + 1]] += toFather[edges[v][i].first];
    } else {
      if (l[v][i] > r[v][i + 1] && !badl[v][i] && chosenl[v][i] != f)
        fromFather[chosenl[v][i]] += fromFather[v];
      if (r[v][i + 1] > l[v][i] && !badr[v][i + 1] && chosenr[v][i + 1] != f)
        fromFather[chosenr[v][i + 1]] += fromFather[v];
    }
  }
  if (monst[v] && !badl[v][edges[v].size()] && chosenl[v][edges[v].size()] != f)
    fromFather[chosenl[v][edges[v].size()]]++;
  for (int i = 0; i < edges[v].size(); i++)
    if (edges[v][i].first != f) fillFromFather(edges[v][i].first, v);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    monst[a] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    edges[a].push_back(pair<int, int>(b, c));
    edges[b].push_back(pair<int, int>(a, c));
  }
  longPathChild(1, -1);
  longPathFather(1, -1, -1000000000);
  fillFromFather(1, -1);
  int best = 0, bestcnt = 0;
  for (int i = 1; i <= n; i++) {
    if (monst[i]) continue;
    if (cnt[i] > best) {
      best = cnt[i];
      bestcnt = 1;
    } else if (cnt[i] == best)
      bestcnt++;
  }
  cout << best << " " << bestcnt << endl;
}
