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 mod = 1000000007;
const int MAXN = 1000006;
int n;
vector<vector<pair<int, int>>> V;
vector<char> S;
map<pair<int, int>, pair<long long, int>> MEM;
struct cmp {
  bool operator()(pair<pair<int, int>, pair<long long, int>> a,
                  pair<pair<int, int>, pair<long long, int>> b) const {
    if (a.second != b.second) return a.second > b.second;
    return a.first < b.first;
  }
};
pair<long long, int> dfs(int u, int par) {
  {
    auto it = MEM.find(pair<int, int>(u, par));
    if (it != MEM.end()) return it->second;
  }
  pair<long long, int> ret = pair<long long, int>(S[u] ? 0 : -inft, -1);
  pair<int, int> jaki = pair<int, int>(-1, -1);
  for (pair<int, int> e : V[u])
    if (e.first != par) {
      pair<long long, int> ww = dfs(e.first, u);
      ww.first += e.second;
      if (ww.first == ret.first) {
        jaki = pair<int, int>(ret.second, e.first);
        ret.second = -1;
      } else if (ww.first > ret.first)
        ret = pair<long long, int>(ww.first, e.first);
    }
  if (par == -1) {
    if (jaki.first == -1) jaki.second = -1;
    for (pair<int, int> e : V[u]) {
      pair<long long, int> ww = dfs(e.first, u);
      ww.first += e.second;
      if (ww.first == ret.first) {
        if (ret.second != -1)
          dfs(u, e.first);
        else if (e.first == jaki.first || e.first == jaki.second)
          MEM[pair<int, int>(u, e.first)] =
              pair<int, int>(ret.first, e.first ^ jaki.first ^ jaki.second);
        else
          MEM[pair<int, int>(u, e.first)] = ret;
      } else
        MEM[pair<int, int>(u, e.first)] = ret;
    }
  }
  return MEM[pair<int, int>(u, par)] = ret;
}
void wave(int u, int par) {
  dfs(u, -1);
  for (pair<int, int> e : V[u])
    if (e.first != par) wave(e.first, u);
}
void solve() {
  int k;
  scanf("%d%d", &n, &k);
  vector<int> P;
  V.resize(n);
  S.resize(n);
  for (int j = 0; j < (k); ++j) {
    int first;
    scanf("%d", &first);
    first--;
    P.push_back(first);
    S[first] = 1;
  }
  for (int j = 0; j < (n - 1); ++j) {
    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));
  }
  wave(0, -1);
  map<pair<pair<int, int>, pair<long long, int>>, int, cmp> M;
  vector<int> ANS(n);
  for (int first : P)
    M[make_pair(pair<int, int>(first, -1), MEM[pair<int, int>(first, -1)])]++;
  while (!M.empty()) {
    pair<int, int> e = M.begin()->first.first;
    int next = M.begin()->first.second.second;
    long long ile = M.begin()->second;
    M.erase(M.begin());
    ANS[e.first] += ile;
    if (next != -1)
      M[make_pair(pair<int, int>(next, e.first),
                  MEM[pair<int, int>(next, e.first)])] += ile;
  }
  pair<int, int> best = pair<int, int>(-1, -1);
  for (int i = 0; i < (n); ++i)
    if (!S[i]) {
      if (ANS[i] > best.first) best = pair<int, int>(ANS[i], 0);
      if (ANS[i] == best.first) best.second++;
    }
  printf("%d %d\n", best.first, best.second);
  V.clear();
  S.clear();
  MEM.clear();
}
int main() {
  int te = 1;
  for (int ti = 0; ti < (te); ++ti) solve();
  return 0;
}
