1.If you know which is the first activity, just start it by overiding the onBackPressed().
@Override
public void onBackPressed() {
Intent intent = new Intent(Third.this,First.class);
startActivity(intent);
}
2.You can also call finish() immediately after you start Third activity. So that on back pressed, will go back to the first activity.
Intent intent = new Intent(Second.this, Third.class);
startActivity(intent);
finish();
3.Prevent the second activity from being added to history stack.
Intent intent = new Intent(First.this, Second.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);