Study of charged hadronic five-body decays of the D+ and D(s)+ mesons