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 Sn = 200020;
struct edge {
  int len, to, nx;
};
edge E[Sn];
int qE[Sn], En = 1;
int n, m, sB[Sn];
int Dc[Sn], des[Sn];
int Uc[Sn], ues[Sn], Ua[Sn];
int S[Sn], Si[Sn], D[Sn], eD[Sn], pD[Sn], Dn;
int pre[Sn], pp[Sn], po[Sn];
int suf[Sn], ss[Sn], so[Sn];
vector<int> Ev[Sn];
int px[Sn], py[Sn], pn;
int TR[Sn], bkn[Sn];
int Ans = -1, Cnt = 0, wt;
bool maxit(int& a, int b) {
  if (b > a) a = b;
}
void add(int c) {
  for (int j = c; j <= n; j += j & -j) TR[j]++;
}
void dec(int c) {
  for (int j = c; j <= n; j += j & -j) TR[j]--;
}
int gts(int c) {
  int rn = 0;
  for (int j = c; j; j -= j & -j) rn += TR[j];
  return rn;
}
void dp_down(int d, int fa) {
  int ds = -1, ct = 0, co = 0;
  D[++Dn] = d, pD[d] = Dn;
  for (int j = qE[d], k, l; k = E[j].to, l = E[j].len, j; j = E[j].nx)
    if (k != fa) {
      dp_down(k, d);
      if (des[k] == -1)
        continue;
      else
        maxit(ds, des[k] + l);
    }
  if (sB[d]) maxit(ds, 0);
  des[d] = ds;
  for (int j = qE[d], k, l; k = E[j].to, l = E[j].len, j; j = E[j].nx)
    if (k != fa)
      if (des[k] + l == ds) ct++, co = k;
  if (ct == 1)
    Dc[d] = Dc[co];
  else
    Dc[d] = d;
  eD[d] = Dn;
}
void dp_upon(int d, int fa) {
  int sons = 0, q = 0;
  for (int j = qE[d], k, l; k = E[j].to, l = E[j].len, j; j = E[j].nx)
    if (k != fa) S[++sons] = des[k] + l, Si[sons] = k;
  if (d == 1) ues[d] = -1;
  pre[0] = suf[sons + 1] = -1;
  for (int i = 1; i <= sons; i++)
    if (S[i] >= pre[i - 1])
      pp[i] = (S[i] == pre[i - 1]), po[i] = Si[i], pre[i] = S[i];
    else
      pp[i] = pp[i - 1], po[i] = po[i - 1], pre[i] = pre[i - 1];
  for (int i = sons; i >= 1; i--)
    if (S[i] >= suf[i + 1])
      ss[i] = (S[i] == suf[i + 1]), so[i] = Si[i], suf[i] = S[i];
    else
      ss[i] = ss[i + 1], so[i] = so[i + 1], suf[i] = suf[i + 1];
  if (ues[d] == -1 && sB[d]) ues[d] = 0, Uc[d] = Ua[d] = d;
  for (int j = qE[d], k, l; k = E[j].to, l = E[j].len, j; j = E[j].nx)
    if (k != fa) {
      q++;
      int ls = pre[q - 1], rs = suf[q + 1], ms = max(ls, rs);
      if (ues[d] >= ms) {
        ues[k] = ues[d] + l;
        if (ues[d] == ms)
          Uc[k] = Ua[k] = d;
        else
          Uc[k] = Uc[d], Ua[k] = Ua[d];
      } else {
        ues[k] = ms + l;
        if (ls == rs) {
          Uc[k] = d;
          continue;
        }
        if (ls > rs)
          if (pp[q - 1])
            Uc[k] = d;
          else
            Uc[k] = Dc[po[q - 1]];
        if (ls < rs)
          if (ss[q + 1])
            Uc[k] = d;
          else
            Uc[k] = Dc[so[q + 1]];
        Ua[k] = d;
      }
    }
  for (int j = qE[d], k, l; k = E[j].to, l = E[j].len, j; j = E[j].nx)
    if (k != fa) dp_upon(k, d);
}
void rebuild() {
  for (int i = 1; i <= n; i++)
    if (sB[i] && ues[i] != des[i]) {
      if (ues[i] > des[i]) {
        bkn[Ua[i]]--;
        pn++, px[pn] = Ua[i], py[pn] = i;
        pn++, px[pn] = Ua[i], py[pn] = Uc[i];
      } else
        pn++, px[pn] = i, py[pn] = Dc[i];
    }
  for (int i = 1; i <= pn; i++) Ev[px[i]].push_back(i);
}
void workans(int d, int fa) {
  int sz = Ev[d].size();
  for (int i = 0; i < sz; i++) add(pD[py[Ev[d][i]]]);
  bkn[d] += gts(eD[d]) - gts(pD[d] - 1);
  for (int j = qE[d], k, l; k = E[j].to, l = E[j].len, j; j = E[j].nx)
    if (k != fa) workans(k, d);
  for (int i = 0; i < sz; i++) dec(pD[py[Ev[d][i]]]);
}
void watch() {
  for (int i = 1; i <= n; i++) printf("Dc[%d]=%d ", i, Dc[i]);
  printf("\n");
  for (int i = 1; i <= n; i++) printf("Uc[%d]=%d ", i, Uc[i]);
  printf("\n");
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, d; i <= m; i++) scanf("%d", &d), sB[d] = 1;
  for (int i = 1, u, v, w; i < n; i++) {
    scanf("%d%d%d", &u, &v, &w);
    E[++En] = (edge){w, v, qE[u]}, qE[u] = En;
    E[++En] = (edge){w, u, qE[v]}, qE[v] = En;
  }
  dp_down(1, 0);
  dp_upon(1, 0);
  rebuild();
  workans(1, 0);
  for (int i = 1; i <= n; i++)
    if (!sB[i]) {
      if (bkn[i] > Ans)
        Ans = bkn[i], Cnt = 1;
      else if (bkn[i] == Ans)
        Cnt++;
    }
  printf("%d %d\n", Ans, Cnt);
}
