Add top parent page id to body class

found it:

add_filter( 'body_class', 'dc_parent_body_class' );
    function dc_parent_body_class( $classes ) {
        if( is_page() ) { 
            $parents = get_post_ancestors( get_the_ID() );
            $id = ($parents) ? $parents[count($parents)-1]: get_the_ID();
        if ($id) {
            $classes[] = 'top-parent-' . $id;
        } else {
            $classes[] = 'top-parent-' . get_the_ID();
        }
    }

    return $classes;
}