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;
template <class T>
void debug(T a, T b) {
  ;
}
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
namespace std {
template <class S, class T>
ostream& operator<<(ostream& out, const pair<S, T>& a) {
  out << '(' << a.first << ',' << a.second << ')';
  return out;
}
}  // namespace std
long long int readL() {
  long long int res;
  scanf("%I64d", &res);
  return res;
}
void printL(long long int res) { printf("%I64d", res); }
vector<pair<int, int> > g[100005];
pair<int, int> chi_far[100005];
pair<int, pair<int, int> > par_far[100005];
int mark[100005];
int n, m;
void rec(int v, int p, int dep) {
  chi_far[v] = make_pair(-1, -1);
  if (mark[v]) chi_far[v] = make_pair(0, v);
  for (auto e : g[v]) {
    if (e.first == p) continue;
    rec(e.first, v, dep + e.second);
    if (chi_far[e.first].first == -1) continue;
    if (chi_far[v].first == chi_far[e.first].first + e.second) {
      chi_far[v].second = v;
    } else if (chi_far[v].first < chi_far[e.first].first + e.second) {
      chi_far[v] = chi_far[e.first];
      chi_far[v].first += e.second;
    }
  }
}
int sum[100005], decr[100005];
void rec2(int v, int p) {
  vector<pair<int, int> > way;
  for (auto e : g[v]) {
    if (e.first == p) continue;
    if (chi_far[e.first].first != -1) {
      way.push_back(make_pair(chi_far[e.first].first + e.second, e.first));
    }
  }
  if (p != -1 && par_far[v].first != -1)
    way.push_back(make_pair(par_far[v].first, -1));
  if (mark[v]) way.push_back(make_pair(0, v));
  sort((way).begin(), (way).end(), greater<pair<int, int> >());
  way.push_back(make_pair(-1, -1));
  way.push_back(make_pair(-1, -1));
  if (mark[v]) {
    ;
    ;
    if (way[0].first == way[1].first) {
      ;
    } else {
      if (way[0].second == -1) {
        ;
        ;
        ;
        ;
        ;
        ;
        ++sum[v];
        ++sum[par_far[v].second.first];
        sum[par_far[v].second.second]--;
        --decr[par_far[v].second.second];
      } else {
        ;
        ;
        ;
        ;
        ++sum[chi_far[way[0].second].second];
        --sum[v];
      }
    }
  }
  for (auto e : g[v]) {
    if (e.first == p) continue;
    pair<int, int> a, b;
    if (way[0].second == e.first) {
      a = way[1], b = way[2];
    } else {
      a = way[0];
      if (way[1].second == e.first)
        b = way[2];
      else
        b = way[1];
    }
    if (a.first == -1) {
      par_far[e.first] = make_pair(-1, make_pair(-1, -1));
    } else if (a.first == b.first) {
      par_far[e.first] = make_pair(a.first + e.second, make_pair(v, v));
    } else {
      if (a.second == -1)
        par_far[e.first] = make_pair(a.first + e.second, par_far[v].second);
      else if (a.second == v)
        par_far[e.first] = make_pair(a.first + e.second, make_pair(v, v));
      else
        par_far[e.first] = make_pair(a.first + e.second,
                                     make_pair(chi_far[a.second].second, v));
    }
    rec2(e.first, v);
  }
}
pair<int, int> ans = make_pair(-1, -1);
int rec3(int v, int p) {
  int chil = sum[v];
  for (auto e : g[v]) {
    if (e.first == p) continue;
    chil += rec3(e.first, v);
  }
  if (!mark[v]) {
    if (ans.first < chil)
      ans = make_pair(chil, 1);
    else if (ans.first == chil)
      ++ans.second;
  }
  return chil + decr[v];
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < (m); ++i) {
    int a;
    scanf("%d", &a);
    --a;
    mark[a] = 1;
  }
  for (int i = 0; i < (n - 1); ++i) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    --a;
    --b;
    g[a].push_back(make_pair(b, c));
    g[b].push_back(make_pair(a, c));
  }
  rec(0, -1, 0);
  ;
  ;
  rec2(0, -1);
  ;
  ;
  debug(sum, sum + n);
  rec3(0, -1);
  ;
  ;
  cout << ans.first << ' ' << ans.second << endl;
  return 0;
}
