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;
int n, m;
vector<pair<int, int> > v[100050];
int h[100050], max1[100050], max2[100050], yer[100050], yer2[100050],
    seperate[100050], der[100050], root[100050][20];
int lca(int x, int y) {
  if (der[x] < der[y]) swap(x, y);
  for (long long int k = 17; k >= 0; k--)
    if (der[root[x][k]] >= der[y]) x = root[x][k];
  if (x == y) return x;
  for (long long int k = 17; k >= 0; k--)
    if (root[x][k] != root[y][k]) x = root[x][k], y = root[y][k];
  return root[x][0];
}
void dfs(int nod, int pre, int d = 0) {
  der[nod] = d;
  root[nod][0] = pre;
  for (long long int k = 1; k <= 17; k++)
    root[nod][k] = root[root[nod][k - 1]][k - 1];
  max1[nod] = -1;
  max2[nod] = -1;
  if (h[nod]) max1[nod] = 0, yer[nod] = nod;
  for (typeof(v[nod].begin()) it = v[nod].begin(); it != v[nod].end(); it++) {
    int x = it->first;
    int c = it->second;
    if (x == pre) continue;
    dfs(x, nod, d + 1);
    if (max1[x] != -1) {
      if (max1[x] + c >= max1[nod]) {
        max2[nod] = max1[nod];
        max1[nod] = max1[x] + c;
        yer2[nod] = yer[nod];
        yer[nod] = x;
      } else if (max1[x] + c >= max2[nod]) {
        max2[nod] = max1[x] + c;
        yer2[nod] = x;
      }
    }
  }
  if (max1[nod] == max2[nod] or yer[nod] == nod)
    seperate[nod] = nod;
  else
    seperate[nod] = seperate[yer[nod]];
}
int dp[100050];
void dfs2(int nod, int pre, int k, int sep) {
  if (h[nod]) {
    int x, y, l;
    if (k == -1 or sep == -1)
      x = nod, y = seperate[nod];
    else {
      if (k > max1[nod])
        x = nod, y = sep;
      else if (k < max1[nod])
        x = nod, y = seperate[nod];
      else
        x = nod, y = nod;
    }
    l = lca(x, y);
    dp[x]++;
    dp[y]++;
    dp[l]--;
    if (l != 1) dp[root[l][0]]--;
  }
  for (typeof(v[nod].begin()) it = v[nod].begin(); it != v[nod].end(); it++) {
    int x = it->first;
    int c = it->second;
    if (x == pre) continue;
    if (yer[nod] != x) {
      if (k == -1 and max1[nod] == 0) {
        dfs2(x, nod, c, nod);
        continue;
      }
      if (k > max1[nod])
        dfs2(x, nod, k + c, sep);
      else if (k < max1[nod])
        dfs2(x, nod, max1[nod] + c, seperate[yer[nod]]);
      else
        dfs2(x, nod, k + c, nod);
    } else {
      if (k == -1 and max2[nod] == -1) {
        dfs2(x, nod, -1, -1);
        continue;
      }
      if (k == -1 and max2[nod] == 0) {
        dfs2(x, nod, c, nod);
        continue;
      }
      if (k > max2[nod])
        dfs2(x, nod, k + c, sep);
      else if (k < max2[nod])
        dfs2(x, nod, max2[nod] + c, seperate[yer2[nod]]);
      else
        dfs2(x, nod, k + c, nod);
    }
  }
}
int res, s;
void DFS(int nod, int pre) {
  for (typeof(v[nod].begin()) it = v[nod].begin(); it != v[nod].end(); it++)
    if (it->first != pre) {
      DFS(it->first, nod);
      dp[nod] += dp[it->first];
    }
  if (h[nod] == 0) {
    if (dp[nod] == res)
      s++;
    else if (dp[nod] > res) {
      res = dp[nod];
      s = 1;
    }
  }
}
int main() {
  cin >> n >> m;
  for (long long int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    h[x] = 1;
  }
  for (long long int i = 1; i <= n - 1; i++) {
    int x, y, c;
    cin >> x >> y >> c;
    v[x].push_back(make_pair(y, c));
    v[y].push_back(make_pair(x, c));
  }
  dfs(1, 1);
  dfs2(1, 1, -1, -1);
  DFS(1, 1);
  cout << res << " " << s << endl;
}
