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 maxn = 100010, maxs = 200010;
const int inf = 2000000000;
int n, m, ecnt;
pair<int, int> edges[maxs];
bool dat[maxn];
int c[maxn];
int pos[maxn], last[maxn], nowt;
vector<pair<int, int> > ga[maxn];
vector<int> weight[maxn];
void insertunit(int* c, int pos, int x) {
  for (; pos <= n; pos += pos & (-pos)) c[pos] += x;
}
int querysum(int* c, int pos) {
  int ans = 0;
  for (; pos; pos -= pos & (-pos)) ans += c[pos];
  return ans;
}
int lcaf[maxn][20], depth[maxn];
void dfs(int start = 1) {
  pos[start] = ++nowt;
  for (int i = 1; i < 20; i++) lcaf[start][i] = lcaf[lcaf[start][i - 1]][i - 1];
  for (vector<pair<int, int> >::iterator it = ga[start].begin();
       it != ga[start].end(); it++) {
    if (it->first != lcaf[start][0]) {
      lcaf[it->first][0] = start;
      depth[it->first] = depth[start] + 1;
      dfs(it->first);
    }
  }
  last[start] = nowt;
}
int lca(int x, int y) {
  if (depth[x] > depth[y]) swap(x, y);
  for (int i = 19; i >= 0; i--)
    if (lcaf[y][i] && depth[lcaf[y][i]] >= depth[x]) y = lcaf[y][i];
  if (x == y) return x;
  for (int i = 19; i >= 0; i--)
    if (lcaf[x][i] != lcaf[y][i]) x = lcaf[x][i], y = lcaf[y][i];
  return lcaf[x][0];
}
void insertpath(int x, int y) {
  int u = lca(x, y);
  insertunit(c, pos[x], 1);
  insertunit(c, pos[y], 1);
  insertunit(c, pos[u], -1);
  if (depth[u]) insertunit(c, pos[lcaf[u][0]], -1);
}
int querynode(int x) { return querysum(c, last[x]) - querysum(c, pos[x] - 1); }
pair<int, int> f[maxs];
bool vis[maxs];
pair<int, int> getf(int en) {
  if (ga[edges[en].first].size() == 1)
    if (dat[edges[en].first])
      return make_pair(0, edges[en].first);
    else
      return make_pair(-inf, -1);
  if (vis[en]) return f[en];
  vis[en] = true;
  int st = edges[en].first;
  int ed = edges[en].second;
  int nowmin = -inf, cnt = 0, nowlca = -1;
  if (dat[st]) {
    nowmin = 0;
    cnt = 1;
    nowlca = st;
  }
  int p = 0;
  for (vector<pair<int, int> >::iterator it = ga[st].begin();
       it != ga[st].end(); it++, p++)
    if (it->first != ed) {
      pair<int, int> t = getf(it->second);
      if (t.second == -1) continue;
      t.first += weight[st][p];
      if (t.first > nowmin) {
        nowmin = t.first;
        nowlca = t.second;
        cnt = 1;
      } else if (t.first == nowmin)
        cnt++;
    }
  if (cnt > 1)
    f[en] = make_pair(nowmin, st);
  else if (cnt == 1)
    f[en] = make_pair(nowmin, nowlca);
  else
    f[en] = make_pair(-inf, -1);
  return f[en];
}
void processpath() {
  for (int i = 1; i <= n; i++) {
    if (dat[i]) {
      int nowmin = -inf, cnt = 0, nowlca = -1, p = 0;
      for (vector<pair<int, int> >::iterator it = ga[i].begin();
           it != ga[i].end(); it++, p++) {
        pair<int, int> t = getf(it->second);
        if (t.second == -1) continue;
        t.first += weight[i][p];
        if (t.first > nowmin) {
          nowmin = t.first;
          nowlca = t.second;
          cnt = 1;
        } else if (t.first == nowmin) {
          cnt++;
        }
      }
      if (cnt == 1) insertpath(i, nowlca);
    }
  }
}
pair<int, int> getans() {
  int nowmax = 0, cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (dat[i]) continue;
    int t = querynode(i);
    if (t > nowmax) {
      nowmax = t;
      cnt = 1;
    } else if (t == nowmax)
      cnt++;
  }
  return make_pair(nowmax, cnt);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    dat[x] = true;
  }
  for (int i = 1; i < n; i++) {
    int x, y, w;
    scanf("%d%d%d", &x, &y, &w);
    edges[ecnt++] = make_pair(x, y);
    edges[ecnt++] = make_pair(y, x);
    ga[x].push_back(make_pair(y, ecnt - 1));
    ga[y].push_back(make_pair(x, ecnt - 2));
    weight[x].push_back(w);
    weight[y].push_back(w);
  }
  dfs();
  processpath();
  pair<int, int> t = getans();
  printf("%d %d\n", t.first, t.second);
  return 0;
}
