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<pair<int, int> > adj[100000];
pair<int, int> downmost[100000];
int black[100000], parent[100000], delta[100000];
int result[100000];
void dfs2(int v, int p, pair<int, pair<int, int> > up) {
  if (black[v]) up = max(up, make_pair(0, make_pair(v, v)));
  pair<int, int> best[3];
  best[0] = best[1] = best[2] = make_pair(-1000000000, -1);
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int v2 = adj[v][i].first;
    int weight = adj[v][i].second;
    if (v2 == p) continue;
    pair<int, int> cand =
        make_pair(downmost[v2].first + weight, downmost[v2].second);
    if (cand > best[2]) {
      best[2] = cand;
      for (int j = 2; j - 1 >= 0 && best[j] > best[j - 1]; j--)
        swap(best[j], best[j - 1]);
    }
  }
  if (black[v]) {
    int bestdist = max(up.first, best[0].first);
    int nbest = 0;
    for (int j = 0; j < 3; j++)
      if (best[j].first == bestdist) nbest++;
    if (up.first == bestdist) nbest++;
    if (nbest >= 2) {
    } else {
      if (up.first == bestdist) {
        delta[v]++;
        delta[up.second.first]++;
        delta[up.second.second] -= 2;
        delta[up.second.second]++;
        if (parent[up.second.second] != -1) delta[parent[up.second.second]]--;
      } else {
        delta[best[0].second]++;
        if (parent[v] != -1) delta[parent[v]]--;
      }
    }
  }
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int v2 = adj[v][i].first;
    int weight = adj[v][i].second;
    if (v2 == p) continue;
    pair<int, int> cand =
        make_pair(downmost[v2].first + weight, downmost[v2].second);
    pair<int, int> best2[3];
    memcpy(best2, best, sizeof(best2));
    for (int j = 0; j < 2; j++)
      if (best2[j] == cand) {
        swap(best2[j], best2[2]);
        break;
      }
    int bestdist = max(up.first, max(best2[0].first, best2[1].first));
    int nbest = 0;
    for (int j = 0; j < 2; j++)
      if (best2[j].first == bestdist) nbest++;
    if (up.first == bestdist) nbest++;
    if (nbest >= 2) {
      dfs2(v2, v, make_pair(bestdist + weight, make_pair(v, v)));
    } else {
      if (bestdist == up.first)
        dfs2(v2, v, make_pair(up.first + weight, up.second));
      else
        dfs2(v2, v,
             make_pair(best2[0].first + weight, make_pair(best2[0].second, v)));
    }
  }
}
void dfs1(int v, int p) {
  parent[v] = p;
  downmost[v] = make_pair(-1000000000, v);
  if (black[v]) downmost[v] = make_pair(0, v);
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int v2 = adj[v][i].first;
    int weight = adj[v][i].second;
    if (v2 == p) continue;
    dfs1(v2, v);
    int dist2 = downmost[v2].first + weight;
    int joint = downmost[v2].second;
    if (dist2 > downmost[v].first) {
      downmost[v].first = dist2;
      downmost[v].second = joint;
    } else if (dist2 == downmost[v].first) {
      downmost[v].second = v;
    }
  }
}
int dfs3(int v, int p) {
  result[v] = delta[v];
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int v2 = adj[v][i].first;
    if (v2 == p) continue;
    result[v] += dfs3(v2, v);
  }
  return result[v];
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    black[i] = 0;
    delta[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    int id;
    scanf("%d", &id);
    id--;
    black[id] = 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));
  }
  dfs1(0, -1);
  dfs2(0, -1, make_pair(-1000000000, make_pair(0, 0)));
  dfs3(0, -1);
  int retv = -1, retmany = 0;
  for (int i = 0; i < n; i++) {
    if (result[i] > retv) {
      retv = result[i];
      retmany = 1;
    } else if (result[i] == retv) {
      retmany++;
    }
  }
  printf("%d %d\n", retv, retmany);
  return 0;
}
