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 inft = 1000000009;
const int MAXN = 1000006;
bool mon[MAXN];
int wyn[MAXN];
vector<pair<int, int> > V[MAXN];
pair<int, int> BEST[MAXN][3];
pair<int, int> NAJGL[MAXN];
vector<pair<int, int> > pyt[MAXN];
int kolor[MAXN], REP[MAXN], przodek[MAXN];
int find(int first) {
  return REP[first] < 0 ? first : REP[first] = find(REP[first]);
}
int summ[MAXN], parent[MAXN];
void DfsTarjan(int first, int par) {
  parent[first] = par;
  kolor[first] = 1;
  REP[first] = -1;
  przodek[first] = first;
  for (typeof((V[first]).begin()) it = (V[first]).begin();
       it != (V[first]).end(); ++it)
    if (it->first != par) {
      DfsTarjan(it->first, first);
      int a = find(first), b = find(it->first);
      if (REP[a] < REP[b]) swap(a, b);
      REP[b] += REP[a];
      REP[a] = b;
      przodek[b] = first;
    }
  for (typeof((pyt[first]).begin()) it = (pyt[first]).begin();
       it != (pyt[first]).end(); ++it)
    if (kolor[it->first] == 2) {
      int lca = przodek[find(it->first)];
      ;
      summ[lca]--;
      if (parent[lca] != -1) summ[parent[lca]]--;
    }
  kolor[first] = 2;
}
int nr = 0;
void sciezka(int a, int b) {
  if (a == b) return;
  ;
  assert(a != b);
  summ[a]++;
  summ[b]++;
  pyt[a].push_back(pair<int, int>(b, nr));
  pyt[b].push_back(pair<int, int>(a, nr));
}
int tin[MAXN], tout[MAXN], ct;
bool potomek(int a, int b) { return tin[b] <= tin[a] && tin[a] < tout[b]; }
bool init(int u, int par) {
  tin[u] = ct++;
  bool monas = mon[u];
  for (int i = 0; i < (V[u].size()); ++i)
    if (V[u][i].first != par) {
      bool tam = init(V[u][i].first, u);
      monas |= tam;
      if (!tam) continue;
      BEST[u][0] = max(BEST[u][0], pair<int, int>(0, u));
      pair<int, int> q = NAJGL[V[u][i].first];
      q.first += V[u][i].second;
      if (BEST[u][0].first < q.first) {
        BEST[u][2] = BEST[u][1];
        BEST[u][1] = BEST[u][0];
        BEST[u][0] = q;
      } else if (BEST[u][1].first < q.first) {
        BEST[u][2] = BEST[u][1];
        BEST[u][1] = q;
      } else if (BEST[u][2].first < q.first)
        BEST[u][2] = q;
    }
  NAJGL[u] = BEST[u][0];
  if (BEST[u][0].first == BEST[u][1].first) NAJGL[u].second = u;
  ;
  tout[u] = ct;
  return monas;
}
void dfs(int u, int par, pair<int, int> gora) {
  ;
  if (mon[u] && NAJGL[u].first != gora.first) {
    ;
    if (NAJGL[u].first > gora.first)
      sciezka(u, NAJGL[u].second);
    else
      sciezka(u, gora.second);
  }
  for (int i = 0; i < (V[u].size()); ++i)
    if (V[u][i].first != par) {
      pair<int, int> c = BEST[u][0];
      if (c.first && potomek(c.second, V[u][i].first)) c = BEST[u][1];
      pair<int, int> g = gora;
      if (g.first == c.first)
        g.second = u;
      else if (g.first < c.first) {
        int ile = 0;
        for (int j = 0; j < (3); ++j)
          if (!potomek(BEST[u][j].second, V[u][i].first) &&
              BEST[u][j].first == c.first)
            ile++;
        g = c;
        assert(ile);
        if (ile > 1) g.second = u;
      }
      g.first += V[u][i].second;
      dfs(V[u][i].first, u, g);
    }
}
int best, best_cnt;
int DfsWynik(int u, int par) {
  int q = summ[u];
  for (int i = 0; i < (V[u].size()); ++i)
    if (V[u][i].first != par) q += DfsWynik(V[u][i].first, u);
  if (!mon[u]) {
    if (q > best) {
      best = q;
      best_cnt = 0;
    }
    if (q == best) best_cnt++;
  };
  return q;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (3); ++j) BEST[i][j] = pair<int, int>(-1, -1);
  for (int i = 0; i < (m); ++i) {
    int a;
    scanf("%d", &a);
    mon[a - 1] = 1;
  }
  for (int i = 0; i < (n - 1); ++i) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    --a;
    --b;
    V[a].push_back(pair<int, int>(b, c));
    V[b].push_back(pair<int, int>(a, c));
  }
  init(0, -1);
  dfs(0, -1, pair<int, int>(0, -1));
  DfsTarjan(0, -1);
  DfsWynik(0, -1);
  printf("%d %d\n", best, best_cnt);
  return 0;
}
