#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;
}
