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 int inf = 1e9 + 333;
const long long linf = 1e18 + 333;
const int N = 1e5 + 5;
int n, m, dep[N], dad[N], max1[N], max2[N], max3[N], fard1[N], fard2[N], far[N],
    gr[N], cnt[N];
vector<int> q[N];
vector<pair<int, int> > v[N];
bool mon[N];
int f(int x) {
  if (x == gr[x]) return x;
  return gr[x] = f(gr[x]);
}
void dfs(int root, int x) {
  dad[x] = root;
  dep[x] = dep[root] + 1;
  max1[x] = max2[x] = max3[x] = -inf;
  if (mon[x]) max1[x] = 0;
  for (__typeof((v[x]).begin()) it = (v[x]).begin(); it != (v[x]).end(); it++) {
    int p = it->first;
    if (p == root) continue;
    int c = it->second;
    dfs(x, p);
    if (max1[p] + c > max1[x]) {
      max3[x] = max2[x];
      max2[x] = max1[x];
      max1[x] = max1[p] + c;
    } else if (max1[p] + c > max2[x]) {
      max3[x] = max2[x];
      max2[x] = max1[p] + c;
    } else if (max1[p] + c > max3[x])
      max3[x] = max1[p] + c;
  }
}
void dfs2(int root, int x) {
  fard1[x] = fard2[x] = -1;
  if (mon[x]) fard1[x] = x;
  bool flag = 0;
  for (__typeof((v[x]).begin()) it = (v[x]).begin(); it != (v[x]).end(); it++) {
    int p = it->first;
    if (p == root) continue;
    int c = it->second;
    dfs2(x, p);
    if (!flag and max1[p] + c == max1[x]) {
      fard1[x] = fard1[p];
      if (max1[p] > 0 and max1[p] == max2[p]) fard1[x] = p;
      flag = 1;
    } else if (max1[p] + c == max2[x]) {
      fard2[x] = fard1[p];
      if (max1[p] > 0 and max1[p] == max2[p]) fard2[x] = p;
    }
  }
}
void dfs3(int root, int x, int up) {
  int down = max1[x];
  if (up > down) {
    far[x] = far[dad[x]];
    for (__typeof((v[x]).begin()) it = (v[x]).begin(); it != (v[x]).end();
         it++) {
      int p = it->first;
      if (p == root) continue;
      int c = it->second;
      dfs3(x, p, up + c);
    }
  } else {
    if (up == down or max1[x] == max2[x]) {
      far[x] = x;
      for (__typeof((v[x]).begin()) it = (v[x]).begin(); it != (v[x]).end();
           it++) {
        int p = it->first;
        if (p == root) continue;
        int c = it->second;
        if (max1[x] != max2[x] and max1[p] + c == max1[x]) far[x] = far[dad[x]];
        if (max1[x] == max2[x] and up != max1[x] and max2[x] != max3[x] and
            (fard1[p] == fard1[x] or p == fard1[x]))
          far[x] = fard2[x];
        if (max1[x] == max2[x] and up != max1[x] and max2[x] != max3[x] and
            (fard1[p] == fard2[x] or p == fard2[x]))
          far[x] = fard1[x];
        dfs3(x, p, max1[x] + c);
        far[x] = x;
      }
    } else {
      for (__typeof((v[x]).begin()) it = (v[x]).begin(); it != (v[x]).end();
           it++) {
        int p = it->first;
        if (p == root) continue;
        int c = it->second;
        if (max1[p] + c == max1[x]) {
          far[x] = fard2[x];
          if (fard2[x] == -1 or up > max2[x]) far[x] = far[dad[x]];
          if (max2[x] == up or max2[x] == max3[x]) far[x] = x;
          dfs3(x, p, max(up, max2[x]) + c);
        } else {
          far[x] = fard1[x];
          dfs3(x, p, max1[x] + c);
        }
      }
      far[x] = fard1[x];
    }
  }
  if (mon[x]) {
    q[x].push_back(far[x]);
    q[far[x]].push_back(x);
  }
}
void dfs4(int root, int x) {
  gr[x] = x;
  for (__typeof((q[x]).begin()) it = (q[x]).begin(); it != (q[x]).end(); it++) {
    int p = *it;
    if (gr[p]) {
      cnt[x]++;
      cnt[p]++;
      cnt[f(p)]--;
      cnt[dad[f(p)]]--;
    }
  }
  for (__typeof((v[x]).begin()) it = (v[x]).begin(); it != (v[x]).end(); it++) {
    int p = it->first;
    if (p == root) continue;
    dfs4(x, p);
    gr[f(p)] = x;
  }
}
void dfs5(int root, int x) {
  for (__typeof((v[x]).begin()) it = (v[x]).begin(); it != (v[x]).end(); it++) {
    int p = it->first;
    if (p == root) continue;
    dfs5(x, p);
    cnt[x] += cnt[p];
  }
}
int main() {
  cin >> n >> m;
  int root;
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    mon[x] = 1;
    root = x;
  }
  for (int i = 1; i < n; i++) {
    int x, y, c;
    cin >> x >> y >> c;
    v[x].push_back(pair<int, int>(y, c));
    v[y].push_back(pair<int, int>(x, c));
  }
  dfs(0, root);
  dfs2(0, root);
  dfs3(0, root, 0);
  dfs4(0, root);
  dfs5(0, root);
  int mx = 0, ans = 0;
  for (int i = 1; i <= n; i++)
    if (!mon[i] and cnt[i] > mx) mx = cnt[i];
  for (int i = 1; i <= n; i++)
    if (!mon[i] and cnt[i] == mx) ans++;
  cout << mx << ' ' << ans << endl;
  return 0;
}
