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 isblack[100000];
vector<pair<int, int> > adj[100000];
pair<int, int> maxdist[100000];
pair<int, int> downdists[100000];
int result[100000], delta[100000];
pair<int, int> dfs(int v, int parent, int dist, int root) {
  pair<int, int> result = make_pair(-(INT_MAX / 3), -1);
  if (isblack[v]) result = make_pair(dist, v);
  maxdist[v] = max(maxdist[v], make_pair(dist, root));
  for (int i = 0; i < (int)adj[v].size(); i++) {
    if (adj[v][i].first == parent) continue;
    result =
        max(result, dfs(adj[v][i].first, v, dist + adj[v][i].second, root));
  }
  return result;
}
void dfs2(int v, int parent) {
  downdists[v] = make_pair(-(INT_MAX / 3), -(INT_MAX / 3));
  if (isblack[v]) downdists[v].first = 0;
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int v2 = adj[v][i].first;
    if (v2 == parent) continue;
    dfs2(v2, v);
    if (adj[v][i].second + downdists[v2].first > downdists[v].second) {
      downdists[v].second = downdists[v2].first + adj[v][i].second;
      if (downdists[v].second > downdists[v].first)
        swap(downdists[v].first, downdists[v].second);
    }
  }
}
int dfs3(int v, int parent, int dist, int limit, int root) {
  int ret = 0;
  if (isblack[v] && maxdist[v].second == root) {
    int limit2 = downdists[v].first == dist ? v : limit;
    ret++;
    delta[limit2]--;
  }
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int v2 = adj[v][i].first;
    if (v2 == parent) continue;
    int best = downdists[v].first;
    if (best == downdists[v2].first) best = downdists[v].second;
    ret += dfs3(v2, v, dist + adj[v][i].second, best == dist ? v : limit, root);
  }
  result[v] += ret;
  ret += delta[v];
  delta[v] = 0;
  return ret;
}
int main(int argc, char** argv) {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    isblack[i] = 0;
    adj[i].clear();
    result[i] = 0;
    delta[i] = 0;
  }
  for (int j = 0; j < m; j++) {
    int i;
    scanf("%d", &i);
    i--;
    isblack[i] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    a--, b--;
    adj[a].push_back(make_pair(b, c));
    adj[b].push_back(make_pair(a, c));
  }
  int dA = dfs(0, -1, 0, 0).second;
  for (int i = 0; i < n; i++) maxdist[i] = make_pair(-1, -1);
  int dB = dfs(dA, -1, 0, dA).second;
  dfs(dB, -1, 0, dB);
  dfs2(dA, -1);
  dfs3(dA, -1, 0, dA, dA);
  dfs2(dB, -1);
  dfs3(dB, -1, 0, dB, dB);
  int ret = -1, retmany = 0;
  for (int i = 0; i < n; i++)
    if (!isblack[i]) {
      if (result[i] > ret) {
        ret = result[i];
        retmany = 0;
      }
      if (result[i] == ret) retmany++;
    }
  printf("%d %d\n", ret, retmany);
  return 0;
}
