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<int> con[100001], wei[100001];
int go[20][100001];
int pnt[100001];
int fa[100001];
int dep[100001];
int erase(int u, int rt) {
  int k = 0;
  for (int i = 0; i < con[u].size(); i++) {
    int v = con[u][i];
    if (v == rt) continue;
    int tmp = erase(v, u);
    if (tmp) {
      con[u][k] = v;
      wei[u][k] = wei[u][i];
      k++;
    }
  }
  con[u].resize(k);
  wei[u].resize(k);
  if (pnt[u]) k++;
  return k;
}
int nod[100001], dis[100001];
int dfs(int u, int rt) {
  fa[u] = rt;
  dep[u] = dep[rt] + 1;
  if (con[u].empty()) {
    nod[u] = u;
    dis[u] = 0;
    return 0;
  }
  int mx = 0;
  int cnt = 0;
  int snod;
  for (int i = 0; i < con[u].size(); i++) {
    int v = con[u][i];
    if (v == rt) continue;
    int dis = dfs(v, u) + wei[u][i];
    if (dis > mx) {
      mx = dis;
      cnt = 0;
      snod = nod[v];
    }
    if (dis == mx) {
      cnt++;
    }
  }
  if (cnt > 1)
    nod[u] = u;
  else
    nod[u] = snod;
  dis[u] = mx;
  return mx;
}
int sum[100001];
void insert(int u, int v, int ans) {
  sum[u]++;
  sum[v]++;
  sum[ans]--;
  if (fa[ans]) sum[fa[ans]]--;
}
void look(int u, int rt, int mx, int cnod, int ans) {
  if (mx < 0 && pnt[u]) {
    mx = 0;
    cnod = u;
    ans = u;
  }
  if (pnt[u]) {
    if (dis[u] > mx)
      insert(u, nod[u], u);
    else if (dis[u] == mx)
      insert(u, u, u);
    else
      insert(u, cnod, ans);
  }
  int sto[4], sn = 0;
  for (int i = 0; i < con[u].size(); i++) {
    int v = con[u][i];
    if (v == rt) continue;
    int j;
    for (j = 0; j < sn; j++) {
      int tj = sto[j];
      if (dis[v] + wei[u][i] > dis[con[u][tj]] + wei[u][tj]) break;
    }
    for (int k = sn - 1; k >= j; k--) sto[k + 1] = sto[k];
    sto[j] = i;
    sn++;
    if (sn > 3) sn = 3;
  }
  for (int i = 0; i < con[u].size(); i++) {
    int v = con[u][i];
    if (v == rt) continue;
    int smx = -1100000000;
    int j;
    int cnt = 0;
    int sj;
    for (j = 0; j < sn; j++) {
      int tj = sto[j];
      if (tj == i) continue;
      int tdis = dis[con[u][tj]] + wei[u][tj];
      if (smx < tdis) {
        smx = tdis;
        cnt = 0;
        sj = tj;
      }
      if (smx == tdis) {
        cnt++;
      }
    }
    if (smx > mx) {
      if (cnt > 1) {
        look(v, u, smx + wei[u][i], u, u);
      } else {
        look(v, u, smx + wei[u][i], nod[con[u][sj]], u);
      }
    } else if (smx == mx) {
      look(v, u, smx + wei[u][i], u, u);
    } else {
      look(v, u, mx + wei[u][i], cnod, ans);
    };
  }
}
void calc(int u, int rt) {
  for (int i = 0; i < con[u].size(); i++) {
    int v = con[u][i];
    if (v == rt) continue;
    calc(v, u);
    sum[u] += sum[v];
  }
}
int main() {
  int n, m, a, i, j, k, b, c;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &a);
    pnt[a] = 1;
  }
  for (i = 0; i < n - 1; i++) {
    scanf("%d %d %d", &a, &b, &c);
    con[a].push_back(b);
    con[b].push_back(a);
    wei[a].push_back(c);
    wei[b].push_back(c);
  }
  erase(1, 0);
  dfs(1, 0);
  for (i = 1; i <= n; i++) go[0][i] = fa[i];
  for (i = 1; (1 << i) <= n; i++) {
    for (j = 1; j <= n; j++) go[i][j] = go[i - 1][go[i - 1][j]];
  }
  look(1, 0, -1100000000, 0, 0);
  calc(1, 0);
  int mx = -1;
  int cnt = 0;
  for (i = 1; i <= n; i++)
    if (!pnt[i]) {
      if (mx < sum[i]) {
        mx = sum[i];
        cnt = 0;
      }
      if (mx == sum[i]) cnt++;
    }
  printf("%d %d\n", mx, cnt);
}
