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

                        // ALLAH \\
                who is Hussain? -> whoishussain.org
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5 + 100;
#define pii pair<int,int>
#define F first
#define S second
#define mk make_pair
vector<pii> adj[ N ];
int n, m, a[ N ], tu[ N ], td[ N ], inf = 1e17, ans[ N ];
pii dis[ N ], tdis[ N ][ 2 ];
bool is[ N ];
int in(){ int x; scanf("%lld",&x); return x; }
void mxadd(pii &a, int b, pii &t1, pii &t2, int u )
{
    if( a.F == b ) t1.F++;
    if( a.S == b ) t2.F++;
    if( a.F >= b )
    {
        if( a.S < b )
            a.S = b, t2.F = 1, t2.S = u;
    }
    else swap(t1,t2),a.S = a.F, a.F = b, t1.F = 1, t1.S = u;
}
void mxdis(int v, int p = -1)
{
    for(auto u : adj[ v ] )
    {
        if( u.F == p ) continue;
        mxdis(u.F,v);
        mxadd(dis[v], dis[u.F].F + u.S, tdis[v][0], tdis[v][1], u.F);
    }
}
void updis(int v, int p = -1)
{
    for( auto u : adj[ v ] )
    {
        if( u.F == p ) continue;
        if( dis[ v ].F == dis[ u.F ].F + u.S )
            mxadd(dis[u.F], dis[ v ].S + u.S, tdis[ u.F ][0], tdis[ u.F ][1], v);
        else mxadd(dis[u.F],dis[ v ].F + u.S, tdis[ u.F ][0], tdis[ u.F ][1], v);
        updis(u.F,v);
    }
}
pii fans;
void updfs(int v, int p = -1 , int w = 0)
{
    for( auto u : adj[ v ] )
    {
        if( u.F == p ) continue;
        updfs( u.F, v, u.S );
        ans[ v ] += td[ u.F ];
        if( tdis[ v ][0].F == 1 )
        {
            if( tdis[ v ][0].S == p )
                td[ v ] += td[ u.F ];
            else 
            {
                if( tdis[ v ][0].S == u.F )
                {
                    if( tdis[ v ][1].F > 1 ) continue;
                    if( tdis[ v ][1].S == p )
                        td[ v ] += td[ u.F ];
                    else tu[ tdis[ v ][1].S ] += td[ u.F ];
                }
                else tu[ tdis[ v ][0].S ] += td[ u.F ];
            }
        } 
    }
    if( tdis[ v ][0].F == 2 )
    {
        if( tdis[ v ][0].S == p )
            td[ p ] += td[ tdis[ v ][ 1 ].S ];
        else if( tdis[ v ][1].S == p )
            td[ p ] += td[ tdis[ v ][ 0 ].S ];
        else tu[ tdis[ v ][ 1 ].S ] += td[ tdis[ v ][ 0 ].S ], tu[ tdis[ v ][ 0 ].S ] += td[ tdis[ v ][ 1 ].S ];
    }
    if( tdis[v][0].F>1 || !is[ v ] ) return;
    if( tdis[ v ][0].S == p )
        td[ v ]++;
    else tu[ tdis[ v ][0].S ]++;
}
void dwdfs(int v, int p = -1 , int w = 0)
{
    if( p != -1 ){
    ans[ v ] += tu[ v ];
    if( tdis[ v ][0].F == 1 )
    {
        if( tdis[ v ][0].S == p )
        {
            if( tdis[ v ][1].F == 1 )
                tu[ tdis[ v ][1].S ] += tu[ v ];
        }
        else tu[ tdis[ v ][ 0 ].S ] += tu[ v ];
    }
    else if( tdis[ v ][0].F == 2 )
    {
        int c = dis[ p ].F;
        if( dis[ v ].F + w == c ) c = dis[ p ].S + w;
        else c += w;
        if( dis[ v ].F == c )
        {
            for(auto u : adj[ v ] )
                if( u.F != p && dis[ u.F ].S + u.S == dis[ v ].F )
                {
                    tu[ u.F ] += tu[ v ];
                    break;
                }
        }
    }
    }for(auto u : adj[ v ] )
    {
        if( u.F == p ) continue;
        dwdfs( u.F, v,u.S );
    }
}
main()
{
    fans.F = -1;
    fill( dis, dis + N, mk(-inf,-inf) );
    n = in(), m = in();
    for(int i = 0;i < m; i++)
        a[ i ] = in()-1, is[ a[ i ] ] = 1, dis[ a[ i ] ].F = 0;
    for(int i = 0;i < n-1; i++)
    {
        int u = in()-1, v = in()-1, c = in();
        adj[ u ].push_back( pii( v, c ) );
        adj[ v ].push_back( pii( u, c ) );
    }
    mxdis(0);
    updis(0);
    updfs(0);
    dwdfs(0);
    for(int i = 0;i < n; i++)
    {
        if( is[ i ] ) continue;
        if( fans.F < ans[ i ] )
            fans.F = ans[ i ], fans.S = 0;
        if( fans.F == ans[ i ] ) fans.S++;
    }
    cout << fans.F <<' ' << fans.S << endl;
}
